I am trying to use playwright for my project. I encountered an interesting problem. I am trying to run following code:
const { webkit } = require('playwright');
(async () => {
const browser = await webkit.launch({
headless: true
});
const context = await browser.newContext({
ignoreHTTPSErrors: true
})
console.log("page loading")
const page = await context.newPage();
await page.goto('https://godaddy.com', {waitUntil: 'networkidle'});
await browser.close();
console.log("page loaded")
})();
If I run this code I am getting the following log:
buntu@ip-172-31-18-109:~/pwright$ node start
page loading
node:internal/process/promises:246
triggerUncaughtException(err, true /* fromPromise */);
^
page.goto: Peer failed to perform TLS handshake
=========================== logs ===========================
navigating to "https://godaddy.com", waiting until "networkidle"
============================================================
Note: use DEBUG=pw:api environment variable to capture Playwright logs.
Error
at Object.captureStackTrace (/home/ubuntu/pwright/node_modules/playwright/lib/utils/stackTrace.js:50:19)
at Connection.sendMessageToServer (/home/ubuntu/pwright/node_modules/playwright/lib/client/connection.js:65:48)
at Proxy.<anonymous> (/home/ubuntu/pwright/node_modules/playwright/lib/client/channelOwner.js:64:61)
at /home/ubuntu/pwright/node_modules/playwright/lib/client/frame.js:102:65
at Frame._wrapApiCall (/home/ubuntu/pwright/node_modules/playwright/lib/client/channelOwner.js:77:34)
at Frame.goto (/home/ubuntu/pwright/node_modules/playwright/lib/client/frame.js:100:21)
at /home/ubuntu/pwright/node_modules/playwright/lib/client/page.js:303:60
at Page._attributeToPage (/home/ubuntu/pwright/node_modules/playwright/lib/client/page.js:238:20)
at Page.goto (/home/ubuntu/pwright/node_modules/playwright/lib/client/page.js:303:21)
at /home/ubuntu/pwright/start.js:14:16
If I run this code immediately after the first error it runs without any problem. But If I run this code after a minute I am getting the same TLS handshake error again.
How to resolve this problem?
PS: I am not getting this error with chomium but I need to use webkit.