I am using the callback function but at the end under captcha it says 'Character sequences do not match' on gmx.com
here is my python code, using selenium.
code:
I have tried to apply what has been discussed on this forum, but nothing seems to work.
here is my python code, using selenium.
code:
Code:
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,
"useragent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
}
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)
driver.execute_script(
f'document.getElementById("g-recaptcha-response").innerHTML="{requ}";')
driver.execute_script(
f'___grecaptcha_cfg.clients[0].V.V.callback("requ")')
time.sleep(5)
print('inner html thing worked...?')
except JavascriptException:
fail == True
driver.quit()
print('utter failure')
try:
time.sleep(5)
status = 1
time.sleep(2)
driver.find_element_by_id(
"g-recaptcha-response").submit()
print('capthac sucessfull...?')
except JavascriptException:
print("JS FAIL!!")
I have tried to apply what has been discussed on this forum, but nothing seems to work.
Last edited: