gpt4 book ai didi

javascript - 指定 selenium-standalone 的 chromedriver 路径

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:44:20 25 4
gpt4 key购买 nike

我正在尝试启动 selenium-standalone 服务器 ( https://www.npmjs.com/package/selenium-standalone ),但它抛出了一个错误:

14:19:09 /usr/local/lib/node_modules/selenium-standalone/bin/selenium-standalone:54
14:19:09 throw err;
14:19:09 ^
14:19:09 Error: Missing /usr/local/lib/node_modules/selenium-standalone/.selenium/chromedriver/2.18-x64-chromedriver
14:19:09 at /usr/local/lib/node_modules/selenium-standalone/lib/check-paths-existence.js:15:20
14:19:09 at Object.cb [as oncomplete] (fs.js:169:19)
14:19:09 Build step 'Execute shell' marked build as failure

selenium 服务器正在路径中寻找 chromedriver

/usr/local/lib/node_modules/selenium-standalone/.selenium/chromedriver/2.18-x64-chromedriver

默认。

是否可以在运行服务器时在命令行指定 chromedriver 位置?像这样的东西:

selenium-standalone -Dwebdriver.chrome.driver=<path_to_chromedriver> start

最佳答案

可能需要先安装吧!

➜  ~ selenium-standalone install
----------
selenium-standalone installation starting
----------

---
selenium install:
from: https://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.0.jar
to: /usr/local/lib/node_modules/selenium-standalone/.selenium/selenium-server/2.53.0-server.jar
---
chrome install:
from: https://chromedriver.storage.googleapis.com/2.21/chromedriver_mac32.zip
to: /usr/local/lib/node_modules/selenium-standalone/.selenium/chromedriver/2.21-x64-chromedriver


selenium-standalone installation [================== ] 91% 8.2s

selenium-standalone 提供此命令来帮助您下载和安装 chromedriver。此外,它还提供命令来设置和下载 selenium、chromedriver 和架构的不同选项(我没有找到设置路径的命令)

# choose selenium version 
selenium-standalone install --version=2.45.0 --baseURL=https://selenium-release.storage.googleapis.com

# choose chrome driver version
selenium-standalone install --drivers.chrome.version=2.15 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com

# choose ie driver architecture
selenium-standalone start --drivers.ie.arch=ia32 --drivers.ie.baseURL=https://selenium-release.storage.googleapis.com

关于javascript - 指定 selenium-standalone 的 chromedriver 路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33240483/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com