AndreiDrang/python3-anticaptcha

Token - Form submission returning "captcha wrong"

adrianomaia opened this issue · 24 comments

First, thank's for this library.

I'm using the following code to bypass a "Recaptcha":

                ANTICAPTCHA_KEY = ''
                PAGE_URL = url
                SITE_KEY = site_key

                result = NoCaptchaTaskProxyless.NoCaptchaTaskProxyless(anticaptcha_key = ANTICAPTCHA_KEY)\
                .captcha_handler(websiteURL=PAGE_URL,
                             websiteKey=SITE_KEY)
                captcha_answer = result.get("solution").get("gRecaptchaResponse")
                if captcha_answer != "":
                    print(captcha_answer)
                    self.driver.execute_script("document.getElementById('g-recaptcha-response').focus()")
                    time.sleep(2)
                    self.driver.execute_script("document.getElementById('g-recaptcha-response').innerHTML='%s'" % captcha_answer)
                    time.sleep(2)
                    nextBtn = self.driver.find_element_by_xpath("//input[@value='Avançar']")
                    nextBtn.click()

Problem: After click the button to submit the form, the page returns an error concerning the "Captcha wrong".

Can someone help me ?

Hi

  1. Change and hide your anticaptcha_key, cause smb else can use it and spend your money.
  2. Usually if u need solve recaptcha u need make recaptcha textarea visible and then insert captcha-response in it, and only after this steps click button to submit some action(like form send and etc.)
    U can find example here.

Hello @AndreiDrang, than's for the answer.

I'm inserting the token with this section of the code:

self.driver.execute_script("document.getElementById('g-recaptcha-response').innerHTML='%s'" % captcha_answer)

Work's just fine, but when I submit the form, returns the error "Wrong Captcha".
I'm assuming that the token returned is not right..

Can u give link on page with recaptcha?
U can check something:
Open page with captcha(manually), than start captcha solving process(with service), get key and try insert it(also manually) and press submit button. Is it working well?

Also not working that way (but that's normal, because the token varies from recaptcha to recaptcha, right?).

Bad news, u do smth wrong.
Your recaptcha solution key must be valid 120sec after receiving (as i remember).

I will check your link bit later.

I don't understand what I did wrong.
I follow all the steps, tried with two different api_keys, and nothing seems to work.

The returned token never works.
I also attempted another API, same result.

Any news ?

Hi
Nope, try connect to this web site and get white page without any data.
Use proxy, change language in browser.

Just change your default language to PT-BR, and the data will appear.

Okay, I just need to delete all my other languages.
But all is working fine.
Make textarea visible
Get captcha solution
Insert solution
--->
image
Press submit button
--->
image

It's giving you the "Wrong Captcha" error: red alert

Message from the first screen is error from my old try, after this, i receive the
second screen with other error(not captcha, as i understand).
Screen Shot 2019-11-26 at 7 46 55 PM

you use my code?

Can you share the code you use ?

Nope, I just test this method:

Open page with captcha(manually), than start captcha solving process(with service), get key and try insert it(also manually) and press submit button. Is it working well?

If it works - code must work fine if it doesn't work - u need to check your keys/urls and etc.

To solve recaptcha i use code from example.

  • get captcha solving key

Ok, thank you for your time.

To solve recaptcha i use code from example.

  • get captcha solving key

Where is this example ? Sorry, not finding him.

U can use any:
First
Second

Did you use NoCaptchaTask or NoCaptchaTaskProxyless ?

I use Proxyless cause I didn't need any proxy.

Last question, which link did you use do bypass the recapactha ?

https://www.google.com/recaptcha/api2/demo -> this one pointing to the google demo or the one from the website ?

I use link to page with captcha.
For your captcha i use your link.

I understand what I was doing wrong....

I was using the link for the captcha instead I was suppose to use the link for the website containing the captcha.

Thank you for you patience and for this amazing library.