Captcha solveing with requests selenium, 2captcha and python


New member
I'm using 2captcha and selenium, I get a code generated to solve but I'm not able to submit it. I tried this solution Python + Selenium + 2Captcha but I can't manage to make it click.

resp = requests.get(url)
if resp.text[0:2] != 'OK':
    quit('Service error. Error code:' + resp.text)
captcha_id = resp.text[3:]
fetch_url = ""+ service_key + "&action=get&id=" + captcha_id
for i in range(1, 10):
    sleep(5) # wait 5 sec.
    resp = requests.get(fetch_url)
    if resp.text[0:2] == 'OK':
driver.execute_script('var element=document.getElementById("g-recaptcha-response");"";')
driver.execute_script('document.getElementById("g-recaptcha-response").innerHTML = arguments[0]', resp.text[3:])
driver.execute_script('onSubmit(arguments[0])', resp.text[3:])