Hi I'm trying to run selenium using chrome profiles.
Here's my code:
PATH = "C:\chromedriver\chromedriver.exe"
options = webdriver.ChromeOptions()
options.add_experimental_option('excludeSwitches', ['enable-logging'])
options.add_argument('--user-data-dir=C:\\Users\\otter\\AppData\\Local\\Google\\Chrome\\User Data')
options.add_argument("--profile-directory=Profile 2")
driver = webdriver.Chrome(PATH, options=options)
driver.get("www.youtube.com")
But when i run, it throws me this long error:
Message: invalid argument: user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir
Whats wrong? :(
I got the path and profile details from typing chrome://version
in Google Chrome.
It's hard to find a good answer for this . Can anyone help?