Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

202
Views
Envíe una solicitud desde JavaScript para resolver ReCaptcha en Python

Actualmente estoy tratando de iniciar sesión en un sitio a través de Selenium y 2Captcha.

Todo funciona bien en este momento, excepto el Captcha. Cuando intento enviar la solicitud, aparece un error.

 #!/usr/bin/python3 from selenium import webdriver from selenium.webdriver.chrome.service import Service from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.chrome.options import Options import requests, time user_name = "" password = "" api_key = '' site_key = '6LcZlE0UAAAAAFQKM6e6WA2XynMyr6WFd5z1l1Nr' page_url = 'https://www.ebay-kleinanzeigen.de/m-einloggen.html?targetUrl=/' def Solver(): chrome_options = Options() chrome_options.add_argument("start-maximized") chrome_options.add_argument("disable-blink-features=AutomationControlled") chrome_options.add_experimental_option('excludeSwitches', ['enable-automation']) chrome_options.add_experimental_option('useAutomationExtension', False) chrome_options.add_experimental_option('excludeSwitches', ['enable-logging']) chrome_options.add_experimental_option("detach", True) driver = webdriver.Chrome(options=chrome_options,service=Service(ChromeDriverManager().install())) driver.get(page_url) element = driver.find_element_by_id("login-email") element.send_keys(user_name) element = driver.find_element_by_id("login-password") element.send_keys(password) driver.find_element_by_id("gdpr-banner-accept").click() u1 = f"https://2captcha.com/in.php?key={api_key}&method=userrecaptcha&googlekey={site_key}&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}";' submit_js = 'document.getElementById("recaptcha-demo-form").submit();' print(wirte_tokon_js) print('') print(submit_js) driver.execute_script(wirte_tokon_js) time.sleep(3) driver.execute_script(submit_js) time.sleep(10) if __name__ == '__main__': Solver()

Este es el error que recibo.

 selenium.common.exceptions.JavascriptException: Message: javascript error: Cannot read properties of null (reading 'submit')

este sería mi último enfoque para resolver el captcha. Intenté hacer clic en él, incluso usando la posición exacta del marco del captcha para hacer clic en el cuadro

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!