Answers for "Custom delay function for waitfor puppeteer"

0

Custom delay function for waitfor puppeteer

function waitFor(delay) {
    return new Promise(resolve => setTimeout(resolve, delay));
}

page.evaluate(async() => {
     //Define your waitFor function
     //Code to execute before
     await waitFor(1000);
     //Code to execute after the 1000ms time delay
 });
Posted by: Guest on June-13-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language