问题
I would like to run the chrome webdriver on my MAC with my original chrome profile/options, so that i don't need to write a script to log in to the page in the temporary opened automated driver.
my original code without options was run successfully
DRIVER = 'chromedriver'
driver = webdriver.Chrome(DRIVER)
However, when I try to use options I get the following error, and here is my code
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = webdriver.ChromeOptions()
options.add_argument("user-data-dir=/Users/Victor/Library/Application Support/Google/Chrome/Default")
driver = webdriver.Chrome(executable_path = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome", chrome_options=options)
selenium.common.exceptions.WebDriverException: Message: Service /Applications/Google Chrome.app/Contents/MacOS/Google Chrome unexpectedly exited. Status code was: 0
So how may I fix this problem please?
来源:https://stackoverflow.com/questions/60031070/webdriverexception-error-when-using-selenium-chrome-webdriver-with-options