How to wait N seconds before continuing to the next line with Puppeteer?

Sometimes, we want to wait N seconds before continuing to the next line with Puppeteer.

In this article, we’ll look at how to wait N seconds before continuing to the next line with Puppeteer.

How to wait N seconds before continuing to the next line with Puppeteer?

To wait N seconds before continuing to the next line with Puppeteer, we can use the waitForTimeout method.

For instance, we write

await page.waitForTimeout(1000);
await frame.waitForTimeout(1000);

to call waitForTimeout to pause script execution on the page or frame for 1 second.

Conclusion

To wait N seconds before continuing to the next line with Puppeteer, we can use the waitForTimeout method.