python-anticaptcha icon indicating copy to clipboard operation
python-anticaptcha copied to clipboard

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

Open RootEncrypter opened this issue 5 years ago • 22 comments

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?

RootEncrypter avatar Sep 02 '20 11:09 RootEncrypter

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 avatar Sep 02 '20 12:09 ad-m

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 avatar Sep 02 '20 12:09 RootEncrypter

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

RootEncrypter avatar Sep 02 '20 14:09 RootEncrypter

did you find a fix for this?

ItsShajan avatar Sep 11 '20 00:09 ItsShajan

Yes

On Fri, Sep 11, 2020, 4:50 AM ItsShajan [email protected] 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 .

RootEncrypter avatar Sep 11 '20 05:09 RootEncrypter

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 [email protected] 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.

ItsShajan avatar Sep 11 '20 12:09 ItsShajan

same

Pickloe avatar Sep 11 '20 17:09 Pickloe

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 avatar Sep 16 '20 10:09 RootEncrypter

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 [email protected] 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 avatar Sep 17 '20 14:09 RootEncrypter

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 ?

RootEncrypter avatar Sep 17 '20 14:09 RootEncrypter

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..

ghost avatar Oct 07 '20 22:10 ghost

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.

rk0ym avatar Oct 22 '20 03:10 rk0ym

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 avatar Mar 08 '21 19:03 mikegrep

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?

mikegrep avatar Mar 08 '21 20:03 mikegrep

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?

geansduarte avatar Mar 23 '21 20:03 geansduarte

I have same problem

mikegrep avatar Mar 23 '21 20:03 mikegrep

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

... any questions at your disposal.

geansduarte avatar Mar 24 '21 11:03 geansduarte

I have same problem

did u found solution? have same problem

BezIoann avatar May 07 '21 16:05 BezIoann

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?

BezIoann avatar May 07 '21 17:05 BezIoann

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

ghost avatar May 08 '21 10:05 ghost

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!

BezIoann avatar May 11 '21 08:05 BezIoann

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 :/

PuppyLover101 avatar May 03 '22 06:05 PuppyLover101