无法下载硒和/或chromedriver

时间:2019-03-29 07:03:48

标签: selenium selenium-webdriver npm google-chrome-headless

我正在尝试使用selenium-standalone安装npm install,在过去的日子里,现在我可以正常工作了:

selenium-standalone installation starting
----------

---
selenium install:
from: https://selenium-release.storage.googleapis.com/3.12/selenium-server-standalone-3.12.0.jar
to: /root/circleci-dashboard/public/node_modules/selenium-standalone/.selenium/selenium-server/3.12.0-server.jar
---
chrome install:
from: https://chromedriver.storage.googleapis.com/2.43/chromedriver_linux64.zip
to: /root/circleci-dashboard/public/node_modules/selenium-standalone/.selenium/chromedriver/2.43-x64-chromedriver
---
firefox install:
from: https://github.com/mozilla/geckodriver/releases/download/v0.23.0/geckodriver-v0.23.0-linux64.tar.gz
to: /root/circleci-dashboard/public/node_modules/selenium-standalone/.selenium/geckodriver/0.23.0-x64-geckodriver
Failed to download selenium and/or chromedriver: Error: Could not download https://github.com/mozilla/geckodriver/releases/download/v0.23.0/geckodriver-v0.23.0-linux64.tar.gz
    at Request.<anonymous> (/root/circleci-dashboard/public/node_modules/selenium-standalone/lib/install.js:373:21)
    at Request.emit (events.js:182:13)
    at Request.onRequestResponse (/root/circleci-dashboard/public/node_modules/request/request.js:1066:10)
    at ClientRequest.emit (events.js:182:13)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:556:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)
    at TLSSocket.socketOnData (_http_client.js:442:20)
    at TLSSocket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:283:12)
    at readableAddChunk (_stream_readable.js:264:11)
selenium-standalone will attempt to re-download next time it is run.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

1 个答案:

答案 0 :(得分:1)

尝试:

 npm install selenium-standalone@latest -g
 selenium-standalone install && selenium-standalone start

您可以从下面的链接中找到更多信息。

https://www.npmjs.com/package/selenium-standalone