小编use*_*123的帖子

在Python中通过chromedriver设置chrome浏览器二进制文件

我使用Selenium和Python Chrome webdriver.在我使用的代码中:

driver = webdriver.Chrome(executable_path = PATH_TO_WEBDRIVER)
Run Code Online (Sandbox Code Playgroud)

将webdriver指向webdriver可执行文件.有没有办法将webdriver指向Chrome浏览器二进制文件?

https://sites.google.com/a/chromium.org/chromedriver/capabilities中,他们有以下内容(我认为它正是我正在寻找的):

ChromeOptions options = new ChromeOptions();
options.setBinary("/path/to/other/chrome/binary");
Run Code Online (Sandbox Code Playgroud)

有人有Python的例子吗?

python linux selenium google-chrome selenium-webdriver

14
推荐指数
1
解决办法
1万
查看次数