0

After switching to ChromeDriverManager().install(),I am not able to use default profile.Any workaround there so that I can avoid logging in every time?

driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()),....)

used many solutions found here, but still not working. directories: user-data-dir=C:\Users\xxx\AppData\Local\Google\Chrome\User Data user-data-dir=C:\Users\xxx\AppData\Local\Google\Chrome\User Data\Default

2 Answers 2

0

To use the default profile, you have to mention the path like below:

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.chrome.options import Options

options = Options()

# path of the chrome profile's parent directory
options.add_argument(r"user-data-dir=C:\\Users\\User\\AppData\\Local\\Google\\Chrome\\User Data")
# name of the directory
options.add_argument("--profile-directory=Default")

driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)
Sign up to request clarification or add additional context in comments.

2 Comments

Not working aise 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:\Users\Developer\AppData\Local\Google\Chrome\Application\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.) Stacktrace:
Before executing the code, close all of the chrome browser windows and try, because you are running chrome with default profile, if it is already opened, it will be crashed.
0

You may be hitting a Selenium/Chrome profile lock issue. When Chrome is started using a particular user profile, that profile directory is locked by the running process. If a new Chrome instance (launched via ChromeDriver) tries to reuse or access the same profile while another instance is still using it, Chrome opens but may fail to load the default profile

To address this, you can approach it from several angles: What you’re likely running into

*
1)Close any opened instance of browser first,
if not Open browser and close it ,so that it ensures clean exit

  1. load chrome driver with profile*

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.