Categories
JavaScript Answers

How to set navigation timeout with Node.js Puppeteer?

Spread the love

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.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *