custom delay function for waitfor puppeteer

Solutions on MaxInterview for custom delay function for waitfor puppeteer by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "custom delay function for waitfor puppeteer"
Alice
13 Jun 2017
1function waitFor(delay) {
2    return new Promise(resolve => setTimeout(resolve, delay));
3}
4
5page.evaluate(async() => {
6     //Define your waitFor function
7     //Code to execute before
8     await waitFor(1000);
9     //Code to execute after the 1000ms time delay
10 });