Trying to open chrome on my profile with selenium in python 3.8

210 views Asked by At

Every time chrome opens it's not on my profile, so I don't have all of my saved passwords an extensions. I searched for a while and this is what came out. Chrome still opens but it's not on my profile. Can anyone tell me what I've done wrong?

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time

options = webdriver.ChromeOptions()
options.add_argument(r"user-data-dir=C:\Users\Utente\AppData\Local\Google\Chrome\User Data\Profile 1")

PATH = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(PATH)

driver.get("https://www.nike.com/it/launch?s=upcoming")

1

There are 1 answers

0
dbaser On

I think you need a comma after path and then define chrome_options like this:

driver = webdriver.Chrome(executable_path='C:\\path\\to\\chromedriver', chrome_options=options)