我如何使用 npm package selenium-standalone 和 Nightmare.js 而不是下载 selenium jar?

How can I use npm package selenium-standalone with Nightmare.js instead of downloading the selenium jar?

如标题所示,我想将 Nightmare.js 与 selenium 一起使用。但是,他们的文档只提到了 selenium-standalone-xxxx.jar.

我知道有一个名为 selenium-standalone 的 npm 包。我们不能把它和 Nightmare 一起使用吗?如果可以,怎么做? Nightmare 的配置需要 Selenium jar 的路径。

您可以使用 selenium-server-standalone-jar 包

npm install --save-dev selenium-server-standalone-jar

更多信息:https://www.npmjs.com/package/selenium-server-standalone-jar