Last active
May 23, 2020 13:47
-
-
Save pratik-dani/c47f860960905e77fc74c8615fb819e7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(3) | |
else: | |
requ = res.json()['request'] | |
js = f'document.getElementById("g-recaptcha-response").innerHTML="{requ}";' | |
driver.execute_script(js) | |
driver.find_element_by_id("recaptcha-demo-submit").submit() | |
status = 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment