这是我的代码:
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument(r"user-data-dir=C:\Users\shahr\AppData\Local\Google\Chrome\User Data\Profile 1") #Path to your chrome profile
w = webdriver.Chrome(executable_path=r"C:\Program Files (x86)\chromedriver.exe", options=options)
Run Code Online (Sandbox Code Playgroud)
我从其他 StackOverFlow 答案中尝试过此操作,但它拒绝打开所需的配置文件