0

Recently I've been trying to get selenium webdriver to connect to an already existing profile. I've got the code below.

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument("user-data-dir=C:\\Users\\me\\AppData\\Local\\Google\\Chrome\\User Data\\Profile 19")
driver = webdriver.Chrome(executable_path=r'path\to\chromedriver.exe', options = options)

Now what this is supposed to do is launch an existing chrome user, which in my case I created just for this. But instead, it only launches a guest user. I've already tried it with the \Default user in which case it connects just fine, but instead it cannot navigate to any website. I'm appreciative of any help <3

yes
  • 43
  • 8

1 Answers1

3

According to Load Chrome Profile using Selenium WebDriver using java your profile should be put in another option:

options.add_argument("user-data-dir=C:\\Users\\me\\AppData\\Local\\Google\\Chrome\\User Data")
options.add_argument("profile-directory=Profile 19")

Jens Dibbern
  • 1,434
  • 2
  • 13
  • 20