I've successfully implemented captcha solving with 2captcha API up until the point where I input the answer to the hidden answer textbox.
And that's where it starts. The "continue" button is disabled, but even when I delete "disabled" tags in the code it doesn't execute the "login" action it's supposed to execute.
<button disabled="" class="tw-interactive tw-button tw-button--disabled tw-button--full-width">
<span class="tw-button__text" data-a-target="tw-button text">
Continue
</span>
</button>
^ This is the html code for the button when it's disabled [captcha not solved]
<button class="tw-interactive tw-button tw-button--full-width">
<span class="tw-button__text" data-a-target="tw-button-text">
Continue
</span>
</button>
^This is avaliable "continue" button which works when Hand-doing the captcha.
When I change the code from the first to second in HTML, it enables the button but it doesn't execute any actions as I said before Functions like element.submit() don't do anything either
I can't find info about it anywhere but I know it can be handled. The site I'm speaking of is Twitch.tv
This part of my code inputs the captcha answer into the answer textbox
elem=driver.find_element_by_xpath('//*[@id="g-recaptcha-response"]')
driver.execute_script('arguments[0].setAttribute("style", "width: 250px; height: 40px; border: 1px solid #c1c1c1; margin: 10px 25px; padding: 0px; resize: none; ");', elem)
print("answer: "+answer )
elem.send_keys(answer)
================EDIT==================
xlogin = '/html/body/div[2]/div/div/div/div[1]/form/div/div[3]/button'
recaptcha = '//*[@id="recaptcha-element-container"]/div/div/iframe'
answer=''
site_key =''
API_KEY = '#################'
stream = "ninja"
dest = "https://www.twitch.tv/" + stream
def getSiteKey(): #Gets the SITE_KEY and sets the variable
global recaptcha,site_key
element = driver.find_element(By.XPATH,recaptcha)
d = element.get_attribute("src")
trash,rest = d.split("&k=")
site_key,trash = rest.split("&co")
return print("Returned site key: "+site_key)
def handleCaptcha():
global API_KEY, site_key,dest,answer
s = requests.Session()
captcha_id = s.post("http://2captcha.com/in.php?key="+API_KEY+"&method=userrecaptcha&googlekey="+site_key+"&pageurl="+dest).text.split('|')[1]
print ("Request returned captcha ID:"+captcha_id)
recaptcha_answer = s.get("http://2captcha.com/res.php?key={}&action=get&id={}".format(API_KEY, captcha_id)).text
while 'CAPCHA_NOT_READY' in recaptcha_answer:
print (recaptcha_answer)#debug
time.sleep(5)
recaptcha_answer = s.get("http://2captcha.com/res.php?key={}&action=get&id={}".format(API_KEY, captcha_id)).text
recaptcha_answer = recaptcha_answer.split('|')[1]
print("Recaptcha answer is: "+recaptcha_answer)
answer=recaptcha_answer
This is the output I get:

I tried to edit the button code manually in browser debug and couldn't get it to work. I've removed disabled attrib from the button itself and from class-> tw-button--disabled