Skip to content Skip to sidebar Skip to footer

2captcha Api + Selenium

So i'm using this 2captcha API and testing it on a site like omegle.com. The captcha solving happens but the google captcha box doesnt get ticked and nothing happens. Wondering why

Solution 1:

I hope you already found a solution, but want to leave a comment for those who can get stuck at the same point.

  1. The API does work for Selenium too.
  2. The checkbox will not be ticked, it is controlled by ReCaptcha javascript and you do not touch it.
  3. All you need to do is to place the token into g-recaptcha-response field. With Selenium you can do that executing JavaScript
document.querySelector('#g-recaptcha-response').textContent='token_string'
  1. And in your case as there's nothing that submits the form you have to execute the callback function that is JavaScript too. For example:
___grecaptcha_cfg.clients[0].NY.N.callback('token_string')

The path of callback function changes so you need to find a valid one exploring ___grecaptcha_cfg object.

Post a Comment for "2captcha Api + Selenium"