D
D
Danil Samusev2021-07-04 21:38:26
Node.js
Danil Samusev, 2021-07-04 21:38:26

How to fix Playwright proxy error?

I was tormented for a long time, I could not correct the error. Proxy data changed many times.

The code:

const browser = await firefox.launch({
      product: 'firefox',
      ignoreHTTPSErrors: true, 
      proxy: {
        server: `http://${proxy[i].ip}:${proxy[i].port}/`,
        user: username,
        password: password
      }
    });


Console:
(node:61465) UnhandledPromiseRejectionWarning: page.goto: net::ERR_TUNNEL_CONNECTION_FAILED at http://2ip.ru
=========================== logs ===========================
navigating to "http://2ip.ru", waiting until "load"
============================================================
Note: use DEBUG=pw:api environment variable to capture Playwright logs.
Error
    at Object.captureStackTrace (/home/daniil/Рабочий стол/JavaScript/app/node_modules/playwright/lib/utils/stackTrace.js:51:19)
    at Connection.sendMessageToServer (/home/daniil/Рабочий стол/JavaScript/app/node_modules/playwright/lib/client/connection.js:73:48)
    at Proxy.<anonymous> (/home/daniil/Рабочий стол/JavaScript/app/node_modules/playwright/lib/client/channelOwner.js:64:61)
    at /home/daniil/Рабочий стол/JavaScript/app/node_modules/playwright/lib/client/frame.js:100:65
    at Frame._wrapApiCall (/home/daniil/Рабочий стол/JavaScript/app/node_modules/playwright/lib/client/channelOwner.js:77:34)
    at Frame.goto (/home/daniil/Рабочий стол/JavaScript/app/node_modules/playwright/lib/client/frame.js:98:21)
    at /home/daniil/Рабочий стол/JavaScript/накрутка прослушиваний/node_modules/playwright/lib/client/page.js:267:60
    at Page._attributeToPage (/home/daniil/Рабочий стол/JavaScript/накрутка прослушиваний/node_modules/playwright/lib/client/page.js:202:20)
    at Page.goto (/home/daniil/Рабочий стол/JavaScript/app/node_modules/playwright/lib/client/page.js:267:21)
    at /home/daniil/Рабочий стол/JavaScript/app/app.js:27:14
(Use `node --trace-warnings ...` to show where the warning was created)
(node:61465) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:61465) [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.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question