I'm trying to fetch a site while using my profile as per instructions from this post. It successfully launches Chrome instance, but then it just stops and crashes after short amount of time raising below error:
selenium.common.exceptions.WebDriverException: Message: unknown error:
Chrome failed to start: crashed
(Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Windows NT 6.1 SP1 x86_64)
It works fine if I don't use any profile argument though, so I am not sure where's the issue. My code:
def ChromeTest():
options = webdriver.ChromeOptions()
options.add_argument(
"user-data-dir=C:\\Users\\myuser\\AppData\\Local\\Google\\Chrome\\User Data")
driver = webdriver.Chrome(executable_path="C:\\Users\\chromedriver.exe", chrome_options=options))
site = "http://www.google.com"
driver.get(site)