Does anyone know how to setup 2captcha invisible recaptcha with selenium?

Joined
Jan 20, 2016
Messages
439
Reaction score
52
I got the api working with normal recaptcha but the invisible one where you need to inject the answer into the page is fucking me up.

I followed the instructions on their webpage but still have no idea wtf is wrong. I am trying for tumblr/yahoo sign up page.
 
Hello

I'm digging out a post almost a year later.
I managed to solve Invisible ReCAPTCHA V2 (Spotify register) but in some site the JS callback is obfuscated and I can't solve it (Spotify login).
Does somebody managed to solve one ?
 
I also managed to get captchas solved at the old version, but i cant get the Callback submit the login. Anyone managed to find the callback?
 
Yes I succeeded. I found the callback hidden in javascript. I used the help on 2captcha.com API documentation on 2captcha.com/2captcha-api#callback
open the console and call
___grecaptcha_cfg.clients[0].aa.l.callback('TOKEN');
If that doesn't work try looking inside the ___grecaptcha_cfg object
 
Yes I succeeded. I found the callback hidden in javascript. I used the help on 2captcha.com API documentation on 2captcha.com/2captcha-api#callback
open the console and call
___grecaptcha_cfg.clients[0].aa.l.callback('TOKEN');
If that doesn't work try looking inside the ___grecaptcha_cfg object

Just to be clear, where it says TOKEN in your code, do you insert the correct response token 2captcha spits out after one of their workers solves the captcha?
For example, looking through the grecaptcha_cfg object I'm working with, the hierarchy to a callback goes grecaptcha_cfg.clients[0] > es > l > callback, so would I call ___grecaptcha_cfg.clients[0].es.l.callback('recaptchaTOKEN'); in the console or my code to solve it? Whenever I call in the console I will get an undefined response and nothing happens with the recaptcha I'm trying to solve.
 
Last edited:
Hello,
Exactly, the TOKEN is the response token from 2captcha.
The way you're calling the callback is fine as I can see. For testing purpose you can call it in your console.
As soon as you call it, the page will be redirected, no need to click on submit or anything.
Be aware that after each wrong try (bad token, no token, bad login) the captcha on the page is invalidated so you'll need to refresh the page and ask for a new answer to 2captcha.
An undefined response mean that your JS object doesn't exist. Maybe your found the hierarchy a long time ago. Spotify sometimes changes the hierrarchy (and recently did, I heard).
I suggest looking through the grecaptcha_cfg object again
 
Hello,
Exactly, the TOKEN is the response token from 2captcha.
The way you're calling the callback is fine as I can see. For testing purpose you can call it in your console.
As soon as you call it, the page will be redirected, no need to click on submit or anything.
Be aware that after each wrong try (bad token, no token, bad login) the captcha on the page is invalidated so you'll need to refresh the page and ask for a new answer to 2captcha.
An undefined response mean that your JS object doesn't exist. Maybe your found the hierarchy a long time ago. Spotify sometimes changes the hierrarchy (and recently did, I heard).
I suggest looking through the grecaptcha_cfg object again

Whenever I call this I get undefined I'm not sure if I'm reading the hierarchy correctly, added the censors due to paranoia. I have noticed that in the particular captcha I am trying to solve, a seperate <input type="hidden" id="recaptcha-token" value="recatpchaTOKEN"> appears above the captcha box when solving manually as opposed to the one the 2captcha API suggests to insert the token into. Does the injected token 2captcha suggests get referenced by this other input field or am I to try and inject the token there? Appreciate the help so far
 

Attachments

  • consolegrecaptcha.png
    consolegrecaptcha.png
    27.2 KB · Views: 17
Based on your screenshot, I guess there should be a sitekey property out of the screen at the same level of callback property/function. If there's a sitekey property and it is filled in with the right sitekey, then the callback at the same level is the good one to use. If not you need to look again.

I suggest to go take a look on 2captcha.com/API read their API documentation. That's how i finally succeeded in solving these. There's a bit of explanation about JavaScript recaptcha callback
 
Callback is not an issue since 2captcha provides full guide and you gotta do that as instructed in 2captcha api page... Generally there should be no token but if you got token then you gotta use that token. I would suggest you to have a look on api page.
 
Back
Top