【发布时间】:2021-05-03 17:54:33
【问题描述】:
我最近遇到了一个问题,在使用 Selenium 时,我想使用我的默认 chrome 浏览器配置文件,所以它已经登录和一切,但是当在谷歌上搜索时,它给了我一个代码,基本上是这样的:
chrome_options = Options()
chrome_options.add_argument("[path to the profile]")
driver = webdriver.Chrome(chrome_options=chrome_options, executable_path=[path to the webdriver])
我得到的错误是:
NameError: name 'Options' is not defined
我该如何解决这个问题,也许有更好的方法来加载 chrome 配置文件?
【问题讨论】:
标签: python selenium selenium-webdriver web-scraping chrome-options