0

I'm trying to use selenium on OSX to open a chrome window with existing cookies so that I can bypass login. When I don't add the argument 'chrome_options=option' to open chrome with my user settings, the driver.get function works fine and it opens a chrome window with no extensions loaded and browses to the url. But when I use the code as shown below, it simply opens chrome (with all extensions loaded) but does not browse to the URL. Am I missing something simple?

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys 
options = webdriver.ChromeOptions() 
options.add_argument("user-data-dir=/Users/me/Library/Application Support/Google/Chrome/")
driver = webdriver.Chrome("./assets/chromedriver",chrome_options=options)
driver.implicitly_wait(30)
driver.maximize_window()
driver.get("https://www.gmail.com/")
jeb
  • 49
  • 4
  • 1
    Are you sure there isn't a newline in `user-data-\ndir`? – ggorlen Jul 25 '18 at 18:36
  • yes, it is all on a single line – jeb Jul 26 '18 at 13:06
  • thanks. I've updated the code above. It now has everything that is in my py file. Any other ideas? – jeb Jul 26 '18 at 13:14
  • Possible duplicate of [How to load default profile in chrome using Python Selenium Webdriver?](https://stackoverflow.com/questions/31062789/how-to-load-default-profile-in-chrome-using-python-selenium-webdriver) – ggorlen Jul 26 '18 at 17:05

0 Answers0