【发布时间】:2017-12-20 08:27:58
【问题描述】:
我的 chrome 浏览器中有几个自定义配置文件。例如,我想在我的 selenium 中使用“test 2”配置文件。 (见下图)
这是我从网上看到的代码。
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = webdriver.ChromeOptions()
options.add_argument(r'user-data-dir=C:\Users\mycomputer\AppData\Local\Google\Chrome\User Data')
browser = webdriver.Chrome(executable_path=r"C:\Users\mycomputer\AppData\Local\Programs\Python\Python36-32\chromedriver.exe", chrome_options=options)
如何使用“测试 2”配置文件?谢谢。
【问题讨论】:
标签: python python-3.x selenium selenium-chromedriver