我们如何使用Selenium Python以不同的用户身份打开Google chrome?
我正在尝试使用Selenium和Python以“不同用户”的身份打开Chrome浏览器。我该怎么做?非常简单,只需将我们如何使用Selenium Python以不同的用户身份打开Google chrome?,python,selenium,selenium-webdriver,Python,Selenium,Selenium Webdriver,我正在尝试使用Selenium和Python以“不同用户”的身份打开Chrome浏览器。我该怎么做?非常简单,只需将参数添加到chrome\u选项中即可: from selenium import webdriver options = webdriver.ChromeOptions() options.add_argument("user-data-dir=C:\\Path") #Path to your chrome profile w = webdriver.Chrome(execut
参数添加到chrome\u选项中即可:
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)
请参阅:SO的期望是,用户提问时不仅要进行研究以回答自己的问题,还要分享研究、代码尝试和结果。这表明你花了时间来帮助自己,它使我们避免重复显而易见的答案,最重要的是,它帮助你得到一个更具体和相关的答案!另见: