--user-data-dir profile problems

5,160 views
Skip to first unread message

Malte

unread,
Mar 4, 2023, 10:31:01 AM3/4/23
to ChromeDriver Users
Hi,

I am facing problems with loading chrome profiles.
Even with a very simple script i got an error on options.
Chrome starts and opens with user profile 6, i can use the browser manually, but the script stops and doenst open google.com.
when i comment out the user profile options
#options.add_argument(r"--user-data-dir=C:\Users\malta\AppData\Local\Google\Chrome\User Data")
#options.add_argument(r'--profile-directory=Profile 6')
i got no errors in console and google.com is opening.
Any idea what i am doing wrong? Thanks for any help!

Here my Code:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

#create chromeoptions instance
options = webdriver.ChromeOptions()

#provide location where chrome stores profiles
options.add_argument(r"--user-data-dir=C:\Users\malta\AppData\Local\Google\Chrome\User Data")

#provide the profile name with which we want to open browser
options.add_argument(r'--profile-directory=Profile 6')

#specify where your chrome driver present in your pc
driver = webdriver.Chrome(options=options)

#provide website url here
driver.get("https://www.google.com/")

This is the console output:

Wird in einer aktuellen Browsersitzung ge÷ffnet.
Traceback (most recent call last):
  File "C:\DATA\python\udb.py", line 16, in <module>
    driver = webdriver.Chrome(options=options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\malta\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 80, in __init__
    super().__init__(
  File "C:\Users\malta\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 104, in __init__
    super().__init__(
  File "C:\Users\malta\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 286, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Users\malta\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 378, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\malta\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 440, in execute
    self.error_handler.check_response(response)
  File "C:\Users\malta\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 245, in check_response
    raise exception_class(message, screen, stacktrace)
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\Google\Chrome\Application\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Stacktrace:

chromedriver: ChromeDriver 110.0.5481.77
Chrome Version 110.0.5481.178

Michael Odumosu

unread,
Mar 6, 2023, 7:54:08 AM3/6/23
to ChromeDriver Users
Im having same issue too this code at least opened chrome but the selenium process fails
this is java
```
  @Override
  public  WebDriver getDriver(Boolean headless) {

    System.setProperty(
      "webdriver.chrome.driver",
      CommonUtils.dotenv.get("CHROMEDRIVER")
    );

    ChromeOptions options = new ChromeOptions();
    options
    .addArguments("--no-sandbox")
    .addArguments("--user-data-dir=C:\\Users\\Restop-8734\\AppData\\Local\\Google\\Chrome\\User Data")
    .addArguments("--start-maximized")
    .addArguments("disable-infobars")
    .addArguments("--disable-extensions")
    .addArguments("--disable-gpu")
    .addArguments("--disable-gpu")
    .addArguments("--disable-dev-shm-usage'")
    .addArguments("--profile-directory=Default")
    .setExperimentalOption("useAutomationExtension", false);
    if(headless == true){
      options.addArguments("--headless");
    }
    // ChromeDriverService service = new ChromeDriverService.Builder()
    // .usingDriverExecutable(new File(CommonUtils.dotenv.get("CHROMEDRIVER")))
    // .build();
    driver = new ChromeDriver(options);
    return driver;
  }
```

Vladimir Nechaev

unread,
Mar 7, 2023, 3:14:05 AM3/7/23
to Michael Odumosu, ChromeDriver Users
Dear Michael,

Which version are you using?
The issue has been fixed in ChromeDriver 111.0.5563.41: https://chromedriver.storage.googleapis.com/111.0.5563.41/notes.txt

Best regards,
Vladimir

--
You received this message because you are subscribed to the Google Groups "ChromeDriver Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromedriver-us...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/chromedriver-users/5078c02d-2fee-40fc-89b6-cb6ebc4d50edn%40googlegroups.com.

Michael Odumosu

unread,
Mar 7, 2023, 7:48:09 AM3/7/23
to ChromeDriver Users
Windows 11 pro
JDK: open jdk java 17.0.4.1 2022-08-18 LTS
mvn v 3.8.7
selenium v4.8.1
chromedriver-v111.0.5563.41-win32
Chrome Version 110.0.5481.178

Michael Odumosu

unread,
Mar 7, 2023, 7:48:45 AM3/7/23
to ChromeDriver Users
However trying trying v 111 withchrome v 110 yields no results do I have to wait to get to v 111
Reply all
Reply to author
Forward
0 new messages