我正在尝试使用Selenium和Python以“以其他用户身份”打开Chrome浏览器。我该怎么办?
答案 0 :(得分:1)
非常简单,只需add_argument
至chrome_options
:
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument("user-data-dir=C:\\Path") #Path to your chrome profile
w = webdriver.Chrome(executable_path=r'C:\Users\chromedriver.exe', chrome_options=options)