Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

365
Visualizações
Captcha reappears using 2captcha token in Selenium

So I am trying to bypass the captcha in this page https://divulgacione14.registraduria.gov.co/ using 2captcha, Selenium and python. An image captcha appears after the "Consulta" button has been clicked a couple of times.

Everything is working fine in the code. However, when I get the token solution from 2captcha, use that as input to the g-recaptcha-response a new recaptcha appears asking me to click on some images.

Here is the code I am using (assume the result['code'] contains the token provided by 2captcha. )

    from selenium import webdriver
    from selenium.webdriver.chrome.service import Service
    from selenium.webdriver.common.by import By

    ser = Service("chromedriver.exe") 
    op = webdriver.ChromeOptions()
    driver = webdriver.Chrome(service = ser, options = op)
    driver.get("https://divulgacione14.registraduria.gov.co/")

    ## Find Captcha area and make it visible
    captcha_res = driver.find_element(By.ID, 'g-recaptcha-response')
    captcha_vis = "arguments[0].setAttribute('style','type: text; visibility:visible;');"
    driver.execute_script(captcha_vis, captcha_res)

    ## Pass as input token for recaptcha
    driver.execute_script('document.getElementById("g-recaptcha-response").innerHTML = arguments[0]', result['code'])
    ## Submit form
    captcha_res.submit()

After submitting the form a captcha appears again asking me to select from a set of images. Anyone knows why the token is not working?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda