首页 > 解决方案 > How to wait for Recaptcha to load in Puppeteer/Pyppeteer?

问题描述

I want to scrape a website and I'm having difficulties with the Recaptcha. I've already figured out a way to solve it but before that method starts I have to make sure Recaptcha is fully loaded, which is what I'm stuck at. I've tried page.waitForSelector('#captchaFormPart > td:nth-child(2) > script:nth-child(1)', options={'visible': True}), I got the selector from inspecting the Recaptcha's box, and it didn't work.

标签: javascriptpython-3.xautomationpuppeteerpyppeteer

解决方案


您可以使用puppeteer-extra-plugin-recaptcha使用2Captcha服务自动解决 reCaptcha。

它将自动等待 reCAPTCHA 脚本(如果有)被加载和初始化。


推荐阅读