Using 2captcha with gmx.com registration error.

slamalon

New member
HI :)
My problem is with the Captcha on Gmx.co.uk.
I am using Selenium and python.
Here is the code that I am for using 2captcha:
Python:
        try:
            site_key = "6Lc7GmIUAAAAAKDjVWk0q9Y5HhN5bNr1ctLZDmnw"
            
            with open(r'api_key.txt', "r") as f:
                api_key = f.read()

                form = {"method": "userrecaptcha",
                        "googlekey": site_key,
                        "key": api_key,
                        "pageurl": driver.current_url,
                        "json": 1,
                        "invisible": 1}
                print('this is a form')
                print(form)
                
                response = requests.post(
                    'http://2captcha.com/in.php', data=form)
                request_id = response.json()['request']

            url = f"http://2captcha.com/res.php?key={api_key}&action=get&id={request_id}&json=1"

            status = 0
            while not status:
                res = requests.get(url)
                if res.json()['status'] == 0:
                    time.sleep(5)
                else:
                    requ = res.json()['request']
                    try:
                        time.sleep(5)
                        js = f'document.getElementById("g-recaptcha-response").innerHTML="{requ}";'
                        print('json passed to inner HTML')
                    except JavascriptException:
                        fail == True
                        driver.quit()
                      
                        print('utter failure')

                    try:
                        driver.execute_script(js)
                        time.sleep(5)
                        driver.find_element_by_id(
                            "g-recaptcha-response").submit()
                        status = 1

                        print('success')
                    except JavascriptException:
                        print("JS FAIL!!")
                        driver.quit()


when the code is executed and the JSON is passed to the innerHTML, but then I get an error on the page:
View attachment 197


This occurs even if I change IP, monitor size, or user agent. I seen to have no problem with some other captchas I have used 2captcha to solve, but this one has me stumped.