thicccat688 / selenium-recaptcha-solver

ReCAPTCHA solver for selenium (Using audio).
MIT License
106 stars 37 forks source link

Having Error after solver.click_recaptcha_v2(iframe=recaptcha_iframe) #17

Closed jasonchong3329 closed 1 year ago

jasonchong3329 commented 1 year ago

Hello,

Need your help , I having error after solver.click_recaptcha_v2(iframe=recaptcha_iframe) , as below :

solver.click_recaptcha_v2(iframe=recaptcha_iframe)

site-packages\selenium_recaptcha_solver\solver.py", line 81, in click_recaptcha_v2 captcha_challenge = self._wait_for_element(

site-packages\selenium_recaptcha_solver\solver.py", line 230, in _wait_for_element return WebDriverWait(self._driver, timeout).until(ec.visibility_of_element_located((by, locator)))

site-packages\selenium\webdriver\support\wait.py", line 95, in until raise TimeoutException(message, screen, stacktrace)

**I noticed that it only work on if have popup press PLAY to listen popout (multi-step audio) , if is single step then will have issue** 

image

thicccat688 commented 1 year ago

Hello,

Usually, when there's a timeout exception, it's because either your internet was too slow or something went wrong in the solving process like Google blocking your IP. However, I see you commented it doesn't work if it's a single step, so can you elaborate on that and include some examples?

I appreciate you making this issue!

jasonchong3329 commented 1 year ago

Hello,

Thank for the reply.

The issue only happen on single step , example code :

recaptcha_iframe = driver.find_element(By.XPATH, '//iframe[@title="reCAPTCHA"]')
solver.click_recaptcha_v2(recaptcha_iframe)  // After resolve the recaptcha , the website will automatically redirect to another page , I can see the resolve recaptcha is successfully and the website is redirect completed.

//other code......

so I'm thinking maybe because the website redirect too fast ?

I have tested your demo's code on my side , it is working.

driver.get('https://www.google.com/recaptcha/api2/demo')
recaptcha_iframe = driver.find_element(By.XPATH, '//iframe[@title="reCAPTCHA"]')
solver.click_recaptcha_v2(iframe=recaptcha_iframe)
print('done')
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.ID, 'recaptcha-demo-submit'))).click()
thicccat688 commented 1 year ago

The only cause I can see for this error is that when it's a single step, and the redirect happens, the redirect is so quick that the script can't verify the checkbox was ticked. I'll think of a fix and issue it soon.

thicccat688 commented 1 year ago

Hello,

I had some time today, so I implemented a fix for your case.

If you have any more issues or suggestions let me know!

jasonchong3329 commented 1 year ago

Hello,

I had some time today, so I implemented a fix for your case.

If you have any more issues or suggestions let me know!

Hello

Sorry , I have update the plugin to 1.8.1

The issue still there , do I need clear any cache?

Error message same :

site-packages\selenium_recaptcha_solver\solver.py", line 81, in click_recaptcha_v2 captcha_challenge = self._wait_for_element(

site-packages\selenium_recaptcha_solver\solver.py", line 230, in _wait_for_element return WebDriverWait(self._driver, timeout).until(ec.visibility_of_element_located((by, locator)))

site-packages\selenium\webdriver\support\wait.py", line 95, in until raise TimeoutException(message, screen, stacktrace)

thicccat688 commented 1 year ago

Hello,

Could you send me the website you're trying to automate (Or send me the script you're using if it doesn't have sensitive data like passwords or secrets)? I can understand what's going on better that way.

jasonchong3329 commented 1 year ago

Hello,

can you give me your email? i email you the detail.

thank you

Hello,

Could you send me the website you're trying to automate (Or send me the script you're using if it doesn't have sensitive data like passwords or secrets)? I can understand what's going on better that way.

thicccat688 commented 1 year ago

Sure, here you go: tomasperestrelo21@gmail.com

jasonchong3329 commented 1 year ago

Sure, here you go: tomasperestrelo21@gmail.com

Hello I have send you an email , please check. Thank you for your help.

thicccat688 commented 1 year ago

Hello,

I'll be checking the issue out soon. Thank you for your cooperation!

pedrofnts commented 1 year ago

I'm having the same issue.

joshuaamedina commented 1 year ago

I noticed that it only work on if have popup press PLAY to listen popout (multi-step audio) , if is single step then will have issue

I am having this issue. Any fixes?

jasonchong3329 commented 1 year ago

hello

recaptcha_iframe = driver.find_element(By.XPATH, '//iframe[@title="reCAPTCHA"]') we can by pass the error for solve the issue , let the process continue run. try : solver.click_recaptcha_v2(recaptcha_iframe) except Exception : pass

......
jasonchong3329 commented 1 year ago

hello we can by pass the error for solve the issue , let the process continue run.

recaptcha_iframe = driver.find_element(By.XPATH, '//iframe[@title="reCAPTCHA"]')

try : 
    solver.click_recaptcha_v2(recaptcha_iframe)
except Exception : 
    pass