1

Hi guys if with your normal browser go on "here" and you solve the Captcha , then if you reload the page you don't have to solve the Captcha again (for the next 5-10 minutes). If I go on the same page with selenium browser and I manually solve the Captcha if I reload the page after 5 seconds I have to redo the Captcha. It's like that when I use selenium it doesn't save the Captcha " cookie/session" I have tried to load my browser session but it's the same.

options = webdriver.ChromeOptions()
options.add_argument("--user-data-dir=C:/Users/User/AppData/Local/Google/Chrome/User Data")

driver = webdriver.Chrome(chrome_options=options,
                             executable_path="C:/chromedriver.exe")

i have even tried to

driver.get("https://www.google.com/recaptcha/api2/demo")

pickle.dump( driver.get_cookies() , open("cookies.pkl","wb"))
time.sleep(60)
cookies = pickle.load(open("cookies.pkl", "rb"))
for cookie in cookies:
    driver.add_cookie(cookie)


driver.get("https://www.google.com/recaptcha/api2/demo")

time.sleep(60)
Save manually the cookies but every time I reload the page I have to redo the Captcha. Is there a way to have the same behavior that I have in my browser? to do the Captcha manually and then for the next 5 minutes don't have to redo it ? thanks so much.
Marià
  • 255
  • 2
  • 12
  • 2
    Did some searching and someone else has reported the same problem [here](https://stackoverflow.com/questions/47963093/selenium-save-recaptcha-cookies-when-going-into-new-tab) - my feeling is that Captcha has detected that you're using a script, after all it is designed to prevent automation. [This post](https://stackoverflow.com/questions/33225947/can-a-website-detect-when-you-are-using-selenium-with-chromedriver) discusses the ways that Selenium can be detected, so it is possible that this is by design. – jbob77435 Sep 17 '18 at 09:12
  • i have tried to follow that but nothing – Marià Sep 17 '18 at 09:29

0 Answers0