ad-m / python-anticaptcha

Client library for solve captchas with Anticaptcha.com support.
http://python-anticaptcha.readthedocs.io/en/latest/
MIT License
219 stars 51 forks source link

recapcha doesn't vanish after injecting the gresponse using python and selenium #80

Open RootEncrypter opened 3 years ago

RootEncrypter commented 3 years ago

To get a clear view i am uploading a link to a video which shows the problem regarding the recapcha. https://drive.google.com/file/d/1Ydsra33hqyb5hRpmekOjk-y_uUw_UL95/view?usp=sharing

I am running a pythn bot to scrape the answers but get this recapcha sometimes. 11

I use anticapcha service to get the token and use code to inject the response : driver.execute_script("document.getElementById('g-recaptcha-response').innerHTML='{}';".format(token))

but the recapcha doesnt dissapear as it DOESN'T have a submit button. The recapcha dissapears only after solving it and goes to the login page. The video will give a clear view of the problem.

What is the procedure to do after injecting g response?

ad-m commented 3 years ago

You need hijack callback and fire it itself. See example https://github.com/ad-m/python-anticaptcha/blob/master/examples/recaptcha_selenium_callback.py .

RootEncrypter commented 3 years ago

You need hijack callback and fire it itself. See example https://github.com/ad-m/python-anticaptcha/blob/master/examples/recaptcha_selenium_callback.py .

How do you hijack the callback function? Exception has occurred: JavascriptException Message: javascript error: grecaptcha.recaptchaCallback[0] is not a function

i get this error after running driver.execute_script("grecaptcha.recaptchaCallback0".format(token))

RootEncrypter commented 3 years ago

when i tried with example site it worked perfectly but with chegg.com it throws me this error : javascript error: grecaptcha.recaptchaCallback[0] is not a function

please help

ItsShajan commented 3 years ago

did you find a fix for this?

RootEncrypter commented 3 years ago

Yes

On Fri, Sep 11, 2020, 4:50 AM ItsShajan notifications@github.com wrote:

did you find a fix for this?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ad-m/python-anticaptcha/issues/80#issuecomment-690807398, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO45BNYJDWX7JB3TVKRGFH3SFFX4HANCNFSM4QS442JA .

ItsShajan commented 3 years ago

Is it possible in any way for me to see the code? I am have researching for a week and hit a dead end.

From: Shaun Menezes Sent: Friday, September 11, 2020 1:47 AM To: ad-m/python-anticaptcha Cc: ItsShajan; Comment Subject: Re: [ad-m/python-anticaptcha] recapcha doesn't vanish after injectingthe gresponse using python and selenium (#80)

Yes

On Fri, Sep 11, 2020, 4:50 AM ItsShajan notifications@github.com wrote:

did you find a fix for this?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ad-m/python-anticaptcha/issues/80#issuecomment-690807398, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO45BNYJDWX7JB3TVKRGFH3SFFX4HANCNFSM4QS442JA .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Pickloe commented 3 years ago

same

RootEncrypter commented 3 years ago

You need hijack callback and fire it itself. See example https://github.com/ad-m/python-anticaptcha/blob/master/examples/recaptcha_selenium_callback.py .

This was working a week back but now it seems to have stopped working, even though I'm calling the callback it does work

RootEncrypter commented 3 years ago

Is it possible in any way for me to see the code? I am have researching for a week and hit a dead end.

From: Shaun Menezes Sent: Friday, September 11, 2020 1:47 AM To: ad-m/python-anticaptcha Cc: ItsShajan; Comment Subject: Re: [ad-m/python-anticaptcha] recapcha doesn't vanish after injectingthe gresponse using python and selenium (#80)

Yes

On Fri, Sep 11, 2020, 4:50 AM ItsShajan notifications@github.com wrote:

did you find a fix for this?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ad-m/python-anticaptcha/issues/80#issuecomment-690807398, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO45BNYJDWX7JB3TVKRGFH3SFFX4HANCNFSM4QS442JA .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Yes
RootEncrypter commented 3 years ago

You need hijack callback and fire it itself. See example https://github.com/ad-m/python-anticaptcha/blob/master/examples/recaptcha_selenium_callback.py .

@ad-m hey I used your technique with chegg.com to bypass their recapcha using the callback but now it doesn't seem to work. I have seen the callback function and it's the same . I used to put the token inside the callback and it used to work but now it doesn't seem to callback for some reason. Could you help me out ?

ghost commented 3 years ago

You need hijack callback and fire it itself. See example https://github.com/ad-m/python-anticaptcha/blob/master/examples/recaptcha_selenium_callback.py .

@ad-m hey I used your technique with chegg.com to bypass their recapcha using the callback but now it doesn't seem to work. I have seen the callback function and it's the same . I used to put the token inside the callback and it used to work but now it doesn't seem to callback for some reason. Could you help me out ?

Hey guys, facing the same problem here.

I'm using the callback_sniffer.js from the examples folder.

It was working fine for a few months, but since last week, I'm seeing this error on FireFox whenever the driver try to open the ReCaptcha window: None of the “sha384” hashes in the integrity attribute match the content of the subresource..

rk0ym commented 3 years ago

same.
If I send response, it shows reCAPTCHA again and again.
I used to bypass it correctly. but recently, I realized I can't bypass.
I doubt it happens cause of PerimeterX.

mikegrep commented 3 years ago

I am on same page i recive g_response injecting and script stop there give some clear example how to use call back to verify the captcha.

mikegrep commented 3 years ago

selenium.common.exceptions.JavascriptException: Message: TypeError: document.getElementById(...) is null with callback sniffer and callback captha After trying the callback I recive selenium.common.exceptions.JavascriptException: Message: TypeError: grecaptcha.recaptchaCallback is undefined Someone fix the problem?

geansduarte commented 3 years ago

Hello guys! I'm using the example with callback_sniffer.js, but it presents a following exception for me on the console: selenium.common.exceptions.JavascriptException: Message: TypeError: grecaptcha.recaptchaCallback is undefined anyone already for this? the website I'm accessing is: http://hcaptcha.jawne.info.pl/recaptcha.php?

mikegrep commented 3 years ago

I have same problem

geansduarte commented 3 years ago

friend, I got it here ... but it was using another library: https://github.com/AndreiDrang/python3-anticaptcha

... any questions at your disposal.

BezIoann commented 3 years ago

I have same problem

did u found solution? have same problem

BezIoann commented 3 years ago

Hello guys! I'm using the example with callback_sniffer.js, but it presents a following exception for me on the console: selenium.common.exceptions.JavascriptException: Message: TypeError: grecaptcha.recaptchaCallback is undefined anyone already for this? the website I'm accessing is: http://hcaptcha.jawne.info.pl/recaptcha.php?

Hi, how did u solve this?

ghost commented 3 years ago

I solved this with using the original callback_sniffer.js and with the following script:

def form_submit(driver, token): driver.execute_script( "document.getElementById('g-recaptcha-response').innerHTML='{}';".format(token) ) driver.execute_script("grecaptcha.recaptchaCallback0".format(token))

Hope this work for u

BezIoann commented 3 years ago

I solved this with using the original callback_sniffer.js and with the following script:

def form_submit(driver, token): driver.execute_script( "document.getElementById('g-recaptcha-response').innerHTML='{}';".format(token) ) driver.execute_script("grecaptcha.recaptchaCallback0".format(token))

Hope this work for u

Thanks!

PuppyLover101 commented 2 years ago

I solved this with using the original callback_sniffer.js and with the following script:

def form_submit(driver, token): driver.execute_script( "document.getElementById('g-recaptcha-response').innerHTML='{}';".format(token) ) driver.execute_script("grecaptcha.recaptchaCallback0".format(token))

Hope this work for u

Thanks!

Traceback (most recent call last):
  File "C:\Users\Administrator\PycharmProjects\EmailCreator\yahoo.py", line 66, in <module>
    assert EXPECTED_RESULT in process(driver)
AssertionError

I get that :/