📜  waitfor puppeteer 的自定义延迟函数 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:01.143000             🧑  作者: Mango

代码示例1
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
 });