1

Hope everyone is doing okay

Currently I’m trying to get info from a page where I have to sign in and then complete a Captcha (selecting different pictures) in order to proceed. The thing is that when I enter the page from my default browser (like manually clicking chrome) I don’t need to sign in and complete the captcha, because I am already signed in (I think because of the cookies?).

Every time I run selenium it opens a “blank” Chrome, is it possible to open a browser with all my data already loaded in order to skip the captcha?

I have tried different solutions explained here but with no success How to save and load cookies using Python + Selenium WebDriver

Thank you very much!

1 Answers1

2

Yes there is a way: You can load your Chromebrowser with the chrome-profile saved on your computer. To do this you have to use webdriver.Chromeoptions().

options = webdriver.ChromeOptions()
options.add_argument(r'--user-data-dir=C:\Users\YourUser\AppData\Local\Google\Chrome\User Data\')
PATH = "/Users/YourUser/Desktop/chromedriver"
driver = webdriver.Chrome(PATH, options=options)

In your chrome-user, every cookie and stuff is saved and you no longer have a clean browser. Remember: There are still websites which can detect that your using selenium, but there are only a few...

Ruben Helsloot
  • 12,582
  • 6
  • 26
  • 49
benicamera
  • 750
  • 1
  • 7
  • 24