Categories
JavaScript Answers

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

Spread the love

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

For instance, we write

await page.waitForTimeout(4000);

to call page.waitForTimeout to pause the program for 4 seconds.

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 *