How to set navigation timeout with Node.js Puppeteer?

Sometimes, we want to set navigation timeout with Node.js Puppeteer.

In this article, we’ll look at how to set navigation timeout with Node.js Puppeteer.

How to set navigation timeout with Node.js Puppeteer?

To set navigation timeout with Node.js Puppeteer, we can call goto with the timeout option.

For instance, we write

await page.goto(url, {
  waitUntil: 'load',
  timeout: 0
});

to call goto with the url to navigate to the URL.

And we call it with an object that has timeout set to 0 to set the navigation timeout to 0ms.

Conclusion

To set navigation timeout with Node.js Puppeteer, we can call goto with the timeout option.