1

I need to make several queries on the website below (for each query I will download a spreadsheet).

https://www.fnde.gov.br/sigpcadm/sistema.pu?operation=localizar

I am using selenium to press the appropriate buttons, however, the captcha is making it impossible to continue with the query.

I'm using an api to solve the captcha but I'm not able to send the response back.

Below is a part of the code.

solver = recaptchaV2Proxyless()
solver.set_verbose(1)
solver.set_key('xxxx')
solver.set_website_url(link)
solver.set_website_key(site_key) 
resposta = solver.solve_and_return_solution() # it works
if resposta != 0:
 print(resposta)
 navegador.execute_script(f"document.getElementById('g-recaptcha-response').innerHTML = '{resposta}'") % apparently it works
 WebDriverWait(navegador, 3).until(EC.frame_to_be_available_and_switch_to_it((By.CSS_SELECTOR,"iframe[name^='a-'][src^='https://www.google.com/recaptcha/api2/anchor?']")))
 # Attempts, but none worked
 #navegador.find_element(By.ID, 'recaptcha-demo-submit').click()
 #navegador.find_element(By.CLASS_NAME, 'recaptcha-checkbox-border').click()
 #navegador.find_element(By.ID, 'g-recaptcha-response-submit').click()
 #navegador.find_element(By.ID, 'submit').click()
else:
 print(solver.err_string)
jottbe
4,5464 gold badges19 silver badges36 bronze badges
asked Mar 27, 2025 at 0:02

1 Answer 1

0

Try to set g-recaptcha-response isn’t always enough i think. some sites require an extra verification step. Try this after setting the response:

navegador.execute_script("document.getElementById('g-recaptcha-response').value = arguments[0];", resposta)
navegador.execute_script("document.getElementById('g-recaptcha-response').dispatchEvent(new Event('change'));")

not all captcha solver work the same way. I had trouble with a few until I switched to one that handled reCAPTCHA more reliably. CapSolver worked well for me just for reference

answered Mar 27, 2025 at 6:30
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.