Hello everyone,
I came across this form while looking for a way to solve a
Recaptcha v2 with a callback function. I've found the forum super helpful, but I am still stuck at the step after solving the Recaptcha.
After I obtain the token with the 2captcha service, I need to invoke the Recaptcha callback and provide it with the token. I found the callback function using
@Mark Miller's amazing
GitHub gist (see the attached screenshot). When I invoke the callback in the
Console in Chrome Dev tools and provide it with the token from 2captcha, I bypass the captcha successfully and get redirected to the search results.
I can invoke the callback function in two ways:
window[___grecaptcha_cfg.clients[0].o.o.callback]('captcha_token')
or
verifyAkReCaptcha('captcha_token')
However, when I invoke these functions using the driver.execute_script() method in Python Selenium, I get an error. I also tried executing other standard Javascript functions with this method (e.g., scrolling down a page), and I keep getting errors. It's likely because domain I am trying to crawl prevents me from executing any Javascript with automation tools.
So, my question is, how can I
invoke the callback function after I obtain the token from the 2captcha service?
Some extra info to help with my question:
1. Automation framework used --> Python Selenium or scrapy. Both are fine by me
2. Code --> In the txt file attached
3. Error messages --> Attached
4. The URL I am trying to crawl -->
"
https://suchen.mobile.de/fahrzeuge/...ue&ms=8600;51;;&ref=quickSearch&sb=rel&vc=Car"
Thank you very much for your help in advance. You'd be helping a brother in dire need