I want my Google Chrome browser, which I opened for web scraping, to open with either the default profile or a specific profile. Selenium automatically opens it as a guest. I tried the code in the image but it didn’t work. How can I solve this problem?
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
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
from selenium.webdriver.chrome.options import Options
#options.add_argument("user-data-
dir=C:\Users\burak\AppData\Local\Google\Chrome\User Data\Person 1")
#options.add_argument("profile-directory={profile}")
options = webdriver.ChromeOptions()
options.add_argument('user-data-
dir=C:\Users\burak\AppData\Local\Google\Chrome\User Data\Person 1')
options.add_argument('profile-directory=Default')
service =
[![enter image description here][1]][1]Service(r"C:\Users\burak\OneDrive\Masaüstü\Python\Scrap\chromedriver.exe")
driver = webdriver.Chrome(service=service, options=options)
driver.get('https://www.google.com/')