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()