-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrating selenium/not submitting form? #19
Comments
@ad-m I just tried that, and it says this - Traceback (most recent call last):
I used this code
|
I need 12 hours to looks over that. Now I am going to sleep. See you soon. |
@jmsp , here is working example for required website. In works on my local station: from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from bs4 import BeautifulSoup
from python_anticaptcha import AnticaptchaClient, NoCaptchaTaskProxylessTask
import re
import pandas as pd
import os
import time
import requests
url = "https://claimittexas.org/app/claim-search"
driver = webdriver.Chrome()
driver.implicitly_wait(30)
driver.get(url)
lastNameField = driver.find_element_by_xpath('//input[@id="lastName"]')
lastNameField.send_keys('Al')
api_key = '....'
site_key = '6LeQLyEUAAAAAKTwLC-xVC0wGDFIqPg1q3Ofam5M' # grab from site
client = AnticaptchaClient(api_key)
task = NoCaptchaTaskProxylessTask(url, site_key)
job = client.createTask(task)
print("Waiting to solution by Anticaptcha workers")
job.join()
# Receive response
response = job.get_solution_response()
print("Received solution", response)
# Inject response in webpage
driver.execute_script('document.getElementById("g-recaptcha-response").innerHTML = "%s"' % response)
# Wait a moment to execute the script (just in case).
time.sleep(1)
# Press submit button
driver.find_element_by_xpath('//button[@type="submit" and @class="btn-std"]').click() |
Does this work with safari or I have to use chromedriver? it didn't work for me when I switched it to safari |
I don't have Safari, so I don't have way to test it. If exists any problem to use Safari in Selenium - this is Safari/Selenium problem, nor |
Do you need additional support? Can you check on Chrome? Can you close the application? |
Is there anything I can help you with? |
I do not see any need for further help, so I am goint to close that issue. If you need further support - let me know. |
For anybody which may it concer I added constatly-tested example how to use |
@ad-m I can't get it working. I am getting following error message:
is_invisible is set to True globally. Changing it to False or removing it does also not work. |
It is working if I am removing is_invisible like this:
But now I am getting another error from:
with the error: Any ideas? I also tried the following:
But I again got an error code saying: I tried using XPathHelper to get the XPath from the submit button, but XPathHelper won't work with this button. I have tried this solution:
With this method the recaptcha submit button gets clicked, but then the recaptcha frame just says "Please select all matching images." So the recapthca is not solved. |
I am also not sure if I do have the correct site-key. I also cant use firebug to find it, because firebug is no longer available. With Firefox Developer its also not working because I never get a google captcha. And firebug with chrome is also not working because I cant see the traffic. Why is there no applicable solution documented? I can only find this with chrome Developer Tools:
This is the best I can get. I hope its the correct site key. |
Hello |
I am using Selenium/Python to try and fill out a form and than fill out the recaptcha. I found python-anticaptcha and bought $10 in credits, and everything is working, the captcha comes up, but than nothing happens. I tried to look for answers for a few hours/consulted their api and examples, but could not find anything. Ultimately, the captcha should work and then the website would generate a table which I am trying to web-scrape
This is what it ends up looking like, but nothing happens and after a minute or so it usually quits, this is the code
The text was updated successfully, but these errors were encountered: