'Puppeteer won't load page
I'm trying to use puppeteer to grab the requests from this page https://www.gsksaglik.com/internal-redirects.html but it seems that the page is not loaded at all because the browser won't close...
This is my code:
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
page.on('request', (data) => console.log(data));
page.on('requestfailed', (data) => console.log(data));
page.on('requestfinished', (data) => console.log(data));
await page.goto('https://www.gsksaglik.com/internal-redirects.html');
await browser.close();
})();
The events page.request, page.requestfailed and requestfinised are not fired
Does anyone know why this page isn't loaded?
Solution 1:[1]
Give timeout mannually
await page.goto('https://www.gsksaglik.com/internal-redirects.html', {
networkIdleTimeout: 5000,
waitUntil: 'networkidle',
timeout: 3000000
});
for more reference check this link https://github.com/GoogleChrome/puppeteer/issues/782
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Shubham Batra |
