Capmonster recaptcha not working properly

kartik garg-25 December 30, 2022

i am trying to automate recaptcha in python selenium webdriver using capmonster api for python but it seems to recieve and send response but not clicking the recaptcha because money is being deducted       

here is my code:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from webdriver_manager.chrome import ChromeDriverManager
#from capmonster_python import NoCaptchaTaskProxyless
from capmonster_python import RecaptchaV2Task

options = Options()
options.add_argument("--lang=en")

browser=webdriver.Chrome(options=options,executable_path=r"C:\Users\irfan\Downloads\chromedriver.exe")
browser.get("https://www.google.com/recaptcha/api2/demo")

website_key="6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-"
website_url=browser.current_url

captcha=RecaptchaV2Task(client_key="Key")
taskId=captcha.create_task(website_url,website_key)
print("Task Created")
response=captcha.join_task_result(taskId)
print("Response Recieved")
browser.execute_script(f"document.getElementsByClassName('g-recaptcha-response')[0].innerHTML = '{response}';")
print("response injected to input")

browser.find_element_by_id("recaptcha-demo-submit").click()
print("#Form Submitted")

1 answer

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 30, 2022

Welcome to the Atlassian Community!

What does this have to do with Confluence?  

Assuming your code is trying to log into Confluence, why is it trying to do captcha work?  That only happens when you've failed to log in too many times, at which point, you should not be trying to automate any log in.  Even assuming there's a good reason to do this in code, what do you mean by "because money is being deducted"?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events