gpt4 book ai didi

node.js - 来自 Selenium : UnhandledPromiseRejectionWarning: Error: ECONNREFUSED connect ECONNREFUSED 的错误

转载 作者:IT老高 更新时间:2023-10-28 23:25:42 25 4
gpt4 key购买 nike

我是 node.js 和 Selenium 的新手,所以如果我没有立即提供所需的所有详细信息,请多多包涵。

这是我想在 FF 中运行的非常简单的测试(我在这里发现了很多这样的问题,但它们指的是 Chrome):

const webdriver = require('selenium-webdriver');

const builder = new webdriver.Builder();
builder.forBrowser('firefox');
const driver = builder.build();

driver.get('https://google.com');

driver.quit();

这是我不断收到的错误:

(node:3534) UnhandledPromiseRejectionWarning: Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:62412 at ClientRequest. (/Users/name/training/learningnodejs/node_modules/selenium-webdriver/http/index.js:244:15) at ClientRequest.emit (events.js:160:13) at Socket.socketErrorListener (_http_client.js:389:9) at Socket.emit (events.js:160:13) at emitErrorNT (internal/streams/destroy.js:64:8) at process._tickCallback (internal/process/next_tick.js:152:19) (node:3534) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) (node:3534) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Selenium 版本:5.6.0

最佳答案

有同样的问题。安装以前版本的 selenium-webdriver 对我有帮助。

npm install selenium-webdriver@3.6.0

关于node.js - 来自 Selenium : UnhandledPromiseRejectionWarning: Error: ECONNREFUSED connect ECONNREFUSED 的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48791928/

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