Enable to submit Google Recaptcha
JRBusiness opened this issue · 3 comments
Hello, first of all, thank you for your great work here!
Okay, so I'm creating a account sign up bot using python, and everything work just fine but when I submit the captcha, it return "Verification unsuccessful. Please try again."
I tried many way but still cannot figure it out why is this happening. Can you point me out where my mistake? Thank you so much.
Here is the callback script of the site for submitting captcha since it doesnt have the submit button.
function attachChoiceHandlers(markupId, callbackScript) { var inputNodes = wicketGet(markupId).getElementsByTagName('input'); for (var i = 0 ; i < inputNodes.length ; i ++) { var inputNode = inputNodes[i]; if (!inputNode.type) continue; if (!(inputNode.className.indexOf('wicket-'+markupId)>=0)&&!(inputNode.id.indexOf(markupId+'-')>=0)) continue; var inputType = inputNode.type.toLowerCase(); if (inputType == 'checkbox' || inputType == 'radio') { Wicket.Event.add(inputNode, 'click', callbackScript); } } }
This is the reCaptcha element:
<textarea id="g-recaptcha-response-1" name="g-recaptcha-response" class="g-recaptcha-response" style="width: 250px; height: 40px; border: 1px solid rgb(193, 193, 193); margin: 10px 25px; padding: 0px; resize: none; display: none;"></textarea>My code for captcha handle:
site_key = self.driver.find_element_by_id("g-recaptcha-panel").get_attribute("data-sitekey")
cap_url = self.driver.find_elements_by_tag_name("iframe")[0].get_attribute("src")
client = AnticaptchaClient(self.ac_token)
task = NoCaptchaTaskProxylessTask(cap_url, site_key)
job = client.createTask(task)
print("Submitting Captcha")
job.join()
response = job.get_solution_response()
print("Submited Captcha", response)
wait(0.5)
self.driver.execute_script('document.getElementById("g-recaptcha-response").innerHTML = "%s"' % response)
wait(2)
self.driver.execute_script("x = document.getElementsByTagName('input')[0];"
"x.click();")
wait(3)
self.driver.find_element_by_class_name("InputSubmit").click()
Sorry I accidently closed it
Okay.
- U use another anticaptcha library - https://github.com/ad-m/python-anticaptcha
- The library is not important, here can be 2 reasons of error:
2.1 Old captcha solve-code.
2.2 Error in captcha solve-code inserting. Can u give a link on sign up form?
I am so sorry for cross posting the issue and I really appreciate you helps sir.
The sign up site is:
https://service.gmx.com/registration.html?edition=us&lang=en
Their captcha submit box is hidden, I was able to reveal the box by changing the element in
"g-recaptcha-response" . There is an option Display:None, then I chang it to true.
But I cannot fund a way to submit it.