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

1 Answers1

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)
AbiSaran
  • 2,538
  • 3
  • 9
  • 15
  • 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: – Rajeev Kumar Dec 12 '22 at 03:44
  • 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. – AbiSaran Dec 12 '22 at 04:10