custom delay function for waitfor puppeteer

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

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 });