I'm working with selenium and keep getting the same error. I've looked through several previous posts and have tried creating a new Chrome profile, moving that profile to a different directory, and simply closing my Chrome browsers then running the script. I keep getting the same error listed below.
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_path = r"C:\Users\chromepath\chromedriver.exe"
options = Options()
options.add_argument("user-data-dir:C:\\Users\\myusername\\Chrome Profiles\\User Data")
options.add_argument("--profile-directory=Profile 1")
driver = webdriver.Chrome(chrome_path, options = options)
driver.get("url")
Traceback (most recent call last):
selenium.common.exceptions.InvalidArgumentException: 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
Any help here would be much appreciated.