Recently I've been trying to open a new chrome window with my user profile. I've got the code below:
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
options = webdriver.ChromeOptions()
options.add_argument("user-data-dir=C:\\Users\\user_name\\AppData\\Local\\Google\\Chrome\\User Data\\")
options.add_argument("profile-directory=Profile 1")
ser = Service("C:\\path\\to\\my\\chromedriver.exe")
driver = webdriver.Chrome(service = ser,options=options)
driver.get('https://www.google.co.in/')
After running it, this error showed up:
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited normally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location C:\Program Files (x86)\Google\Chrome\Application\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Stacktrace:
Backtrace:
(No symbol) [0x0031DCE3]
(No symbol) [0x002B39D1]
(No symbol) [0x001C4DA8]
(No symbol) [0x001E20BC]
(No symbol) [0x001DED19]
(No symbol) [0x002115AE]
(No symbol) [0x0021129C]
(No symbol) [0x0020ACC6]
(No symbol) [0x001E6F68]
(No symbol) [0x001E80CD]
GetHandleVerifier [0x00593832+2506274]
GetHandleVerifier [0x005C9794+2727300]
GetHandleVerifier [0x005CE36C+2746716]
GetHandleVerifier [0x003C6690+617600]
(No symbol) [0x002BC712]
(No symbol) [0x002C1FF8]
(No symbol) [0x002C20DB]
(No symbol) [0x002CC63B]
BaseThreadInitThunk [0x768200F9+25]
RtlGetAppContainerNamedObjectPath [0x77017BBE+286]
RtlGetAppContainerNamedObjectPath [0x77017B8E+238]
It only occurs if another chrome window is opened. How can I fix this?