пишу код для обхода каптчи на сайте, получаю ошибку:
{'status': 1, 'request': '70318662110'}
{'status': 0, 'request': 'CAPCHA_NOT_READY'}
{'status': 0, 'request': 'ERROR_CAPTCHA_UNSOLVABLE'}
код:
from selenium import webdriver
import requests, time
import warnings
from selenium.webdriver.chrome.options import Options
from webdriver_manager.chrome import ChromeDriverManager
warnings.filterwarnings("ignore")
API_KEY = "токен"
data_sitekey = '69f59c273b6e669ac32a6dd5e1b2cb63333d8b00'
page_url ='https://www.blablacar.com.ua/login/email'
opts = Options()
opts.add_argument("user-agent=Mozilla/5.0 (X11; Linux x86_64)")
driver = webdriver.Chrome(ChromeDriverManager().install(), chrome_options=opts)
def Solver():
driver.get(page_url)
u1 = f"https://2captcha.com/in.php?key={API_KEY}&method=userrecaptcha&googlekey={data_sitekey}&pageurl={page_url}&json=1&invisible=1"
r1 = requests.get(u1)
print(r1.json())
rid = r1.json().get("request")
u2 = f"https://2captcha.com/res.php?key={API_KEY}&action=get&id={int(rid)}&json=1"
time.sleep(5)
while True:
r2 = requests.get(u2)
print(r2.json())
if r2.json().get("status") == 1:
form_tokon = r2.json().get("request")
break
time.sleep(5)
wirte_tokon_js = f'document.getElementById("g-recaptcha-response").innerHTML="{form_tokon}";'
driver.execute_script(wirte_tokon_js)
time.sleep(3)
driver.find_element(by=By.XPATH, value='//*[@id="recaptcha-demo-submit"]').click()
time.sleep(10)
if __name__ == '__main__':
Solver()
Что изменить?