Anti-captcha- Error "Captcha Wrong"

Asked

Viewed 193 times

1

I find myself with the following problem:

  • By submitting a form, after solving a captcha, the following error is returned: Captcha Errado

I’m wearing the following API

Code Used:


check_key = self.driver.find_element_by_class_name('g-recaptcha')
site_key = check_key.get_attribute("data-sitekey")
url_key = self.driver.find_element_by_xpath("//iframe[contains(@src,'https://www.google.com/recaptcha/api2/anchor?ar=1&k=" + site_key + "')]")
url = url_key.get_attribute("src")

 ANTICAPTCHA_KEY = api_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').style.display = 'block';")
                        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()

I have the key API and field values url and site_key are being correctly passed.

The value of the field textarea is preemined, however, the error is returned (after clicking the button). Might the returned token be wrong ?

Thank you.

  • I faced problems with captcha too, notice no one answered and it is old question, I do not know this API, but I solved my problems using https:/2captcha.com/, for those who have this problem the site has examples of how to solve these problems.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.