1

I want to solve the ReCaptcha with the 2captcha API. Check this image, there is no submit button for the recaptcha.

enter image description here

I can send request to 2captcha and get the g-recaptcha-response from 2captcha. Then I use the following code to insert the g-recaptcha-response.

document.getElementById("g-recaptcha-response").innerHTML="TOKEN_FROM_2CAPTCHA";

But the problem is that there is no submit button to submit the recaptcha.

Can you please help me to find out the submit button to submit the recaptcha.

Thanks

JamesHorab
  • 107
  • 1
  • 1
  • 7
  • *The question should be updated to include ... the shortest code necessary to reproduce the problem.* – aaron Jan 20 '23 at 15:07
  • What do you mean with "submit button"? Isn't enough to click the checkbox to solve the captcha? – sound wave Jan 20 '23 at 16:28
  • Actually, I am using 2captcha API to solve the ReCaptcha, that's why there is no checkbox clicking option as there is no human click, 1st step is to get the token, I got it, 2nd step is to insert the token using this code document.getElementById("g-recaptcha-response").innerHTML="TOKEN_FROM_2CAPTCHA"; and the last step is to hit the submit button, I am stuck on that. Some websites have submit button or next button but some don't. Only problem with the sites that don't have the next button. – JamesHorab Jan 20 '23 at 16:51

2 Answers2

0

Use a ReCaptcha callback.

In some cases, this may not work!

To find the correct callback character, go into the site you are trying to solve. Open Developer tools/Inspect element and navigate to the Console tab. Then enter ___grecaptcha_cfg.clients[0]. After entering this, you will get a Object returned to you. In my case:

O: 16293487264
S: null
U: null

Now, for every letter in there, try this:

___grecaptcha_cfg.clients[0].letter.letter.callback('recaptcha_token');

You can make an automated method. Something like this:

alphabet = list(string.ascii_lowercase)
for letter in alphabet:
    try:
        driver.execute_script(f"___grecaptcha_cfg.clients[0].{letter.upper()}.{letter.upper()}.callback('{result}');")
        print("Letter was "+letter)
        break
    except:
        pass

Hope this helps!

0

There is no site link in the question, that's why I can't say for sure, but probably there is a callback method that will call after solving the captcha and then the site displays the button, that's why you can't see that button just by setting the captcha token. I did my implementation with this video.

also, there is some blogs that could help you. https://metabypass.tech/blogs

Abbas Habibnejad
  • 433
  • 5
  • 14