Pilv
Pilv

Reputation: 61

Chrome does not load profile

For some reason the program does not load the profile. The location of the profile is fine.

  options = webdriver.ChromeOptions() 
  options.add_argument("user-data-dir=C:\\Users\\Aron\\AppData\\Local\\Google\\Chrome\\User Data\\Profile 2")
  capabilities = DesiredCapabilities.CHROME.copy()
  chromedriver = 'C:\\test\\chromedriver.exe'
  # Opening the browser
  driver = webdriver.Chrome(executable_path = chromedriver, chrome_options=options, desired_capabilities=capabilities)

Upvotes: 0

Views: 1201

Answers (1)

Mace
Mace

Reputation: 1410

Two steps:

1 - When using an empty folder for the profile Chrome creates a new profile in that folder. If it creates the profile you can suppose that it also loads it next time.

options = webdriver.ChromeOptions()
options.add_argument(r"user-data-dir=C:\test\Profile 2")

chromedriver = r'C:\test\chromedriver.exe'
driver = webdriver.Chrome(executable_path=chromedriver, chrome_options=options)

The created folder

2 - But to be sure you can show the used profile in Chrome it self with chrome://version/.

options = webdriver.ChromeOptions()
options.add_argument(r"user-data-dir=C:\test\Profile 2")

chromedriver = r'C:\test\chromedriver.exe'
driver = webdriver.Chrome(executable_path=chromedriver, chrome_options=options)

driver.get('chrome://version/')

input('Enter')

The actual profile

Upvotes: 1

Related Questions