ad-m / ad-m/python-anticaptcha

Selenium not submitting form with anticaptcha

Abierto
#47 8 comentarios 0 reacciones 0 asignados Ver en GitHub
selenium-callback
Lenguaje dominante
Python
Estrellas
230
Forks
53
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

@ad-m
I really tried hard using your code with selenium and chrome.
I want to login on https://services.aig.co.il/PersonalServices/#/login;url=%2Fhome

when I'm trying to login after some attempts there is Recaptcha and I have API_KEY and SITE_KEY. I got a token using website_url and site_key. but still, a successful login is not working.

```
api_key = "**********************"
client = AnticaptchaClient(api_key)

def get_token(website_url, site_key, invisible):
task = NoCaptchaTaskProxylessTask(
website_url=website_url,
website_key=site_key,
is_invisible=invisible
)
job = client.createTask(task)
job.join()
return job.get_solution_response()
```
I got token succesfull but I don't know what is not woking when i'm trying to submit form.

```
site_key = "6LcJ8QgUAAAAAB_VRlbua73AhNAp7b6AVLw-cORX"
__SITE_HOME_PAGE_FOR_CRAWLING = 'https://services.aig.co.il/PersonalServices/#/login;url=%2Fhome'
print("Found site-key", site_key)
invisible_captcha = False
token = get_token(__SITE_HOME_PAGE_FOR_CRAWLING, site_key, invisible_captcha)
print("Found token", token)
print("Received challenge-response")

# Inject response in webpage
current_user_driver.execute_script('document.getElementById("g-recaptcha-response").innerHTML = "%s"' % token)

# submit form
login_form = WebDriverWait(current_user_driver, 10).until(
EC.presence_of_element_located((By.CLASS_NAME, "login__form")))
submit_button = WebDriverWait(login_form, 10).until(
EC.element_to_be_clickable((By.CLASS_NAME, "login__form__button")))
submit_button.click()
```

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.