Comments (7)
I can not reproduce captcha challenge. Could you verify result when you adapt callback sniffer (see https://github.com/ad-m/python-anticaptcha/blob/master/examples/recaptcha_selenium_callback.py )?
from python-anticaptcha.
I can not reproduce captcha challenge.
The problem is that the captcha only appears after several requests of the above type. Hence, it is hard to reproduce.
Could you verify result when you adapt callback sniffer (see https://github.com/ad-m/python-anticaptcha/blob/master/examples/recaptcha_selenium_callback.py )?
I am not sure how to adapt the example. If I interpret the code correctly, you are passing the token twice. The first time by setting the content of g-recaptcha-response
in
driver.execute_script("document.getElementById('g-recaptcha-response').innerHTML='{}';".format(token))
and the second time by calling
driver.execute_script("grecaptcha.recaptchaCallback[0]('{}')".format(token))
The problem is that the page that I am getting has no element g-recaptcha-response
and when I execute the second line I get the error
selenium.common.exceptions.JavascriptException: Message: javascript error: Cannot read property '0' of undefined
I guess the object grecaptcha
is called different in my case?
If I just execute the first comment (setting the response) and then submit the form by calling
driver.execute_script("document.getElementById('gs_captcha_f').submit()';")
I get the error
selenium.common.exceptions.JavascriptException: Message: javascript error: Invalid or unexpected token
from python-anticaptcha.
I tried to get a reproducible captcha and came up with the following request
https://scholar.google.com/scholar?cites=12685256029779217548&as_sdt=2005&sciodt=0,5&hl=en&num=20
The argument num=20
produces a captcha for every call embedded in a site with a slightly different code than the captures I was facing before. However, if I could solve this, it would maybe be a start.
I tried adapting the code from recaptcha_selenium_callback.py and ended up with the following code
from selenium.webdriver.chrome.options import Options
from python_anticaptcha import AnticaptchaClient, NoCaptchaTaskProxylessTask
request = 'https://scholar.google.com/scholar?cites=12685256029779217548&as_sdt=2005&sciodt=0,5&hl=en&num=20'
options = Options()
driver = Chrome(chrome_options=options)
driver.get(request)
api_key = '...'
site_key = '6LfwuyUTAAAAAOAmoS0fdqijC2PbbdH4kjq62Y1b'
client = AnticaptchaClient(api_key)
task = NoCaptchaTaskProxylessTask(request, site_key)
job = client.createTask(task)
job.join()
token = job.get_solution_response()
driver.execute_script(
"document.getElementById('g-recaptcha-response').innerHTML='{}';".format(token)
)
driver.execute_script("submitCallback('{}')".format(token))
result = driver.page_source
The code runs without any errors. However, the display in the browser window does not change and also the variable result still contains the captcha page.
Where did I go wrong?
from python-anticaptcha.
@davidwozabal , could you provide code to reproduce captcha challenge? I do not receive the captcha challenge at the address provided. If I receive such a code - I will be able to analyze the problem more effectively.
from python-anticaptcha.
The link
https://scholar.google.com/scholar?cites=12685256029779217548&as_sdt=2005&sciodt=0,5&hl=en&num=20
above produces a captcha challenge for me (even if I open it from a normal browser from different computers).
from python-anticaptcha.
please help me regarding this issue based on recaptcha
from python-anticaptcha.
Found the solution for the problem
see #92
from python-anticaptcha.
Related Issues (20)
- python-AntiCaptcha not working with web application which requires authentication
- GeeTestTask doesn't support version and requires challenge
- Bad report sending interface
- Cannot use AntiGateTask
- Problem submitting the data
- Unable to submit new captcha token HOT 3
- How to solve captcha on website with ImageToTextTask HOT 1
- [Request] GeeTestTask HOT 2
- How to use Funcaptcha with proxy ? HOT 1
- Need help enter token of Funcaptcha HOT 15
- How to submit the FunCaptcha - Linkedin HOT 4
- s
- I trying to solve hCaptcha. Is solved but not submitted, and stop! HOT 1
- ERROR_TOKEN_EXPIRED when solving geetest slider captcha
- Multiple images selection Recaptcha
- Even after injecting captcha to g-recaptcha-response, captcha isnt bypassing edit: (solved) HOT 2
- Help to find funCaptcha callback on twitch
- TypeError: Object of type 'WebDriver' is not JSON serializable
- Cannot Report Incorrect Captcha Result HOT 2
- Support for ReCaptcha Enterprise? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-anticaptcha.