async function getContent(){
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto(url);
const content = await page.content();
await console.log(content);
await browser.close();
}
setInterval(searchTarget(), 13000);
Run Code Online (Sandbox Code Playgroud)
我有一个异步函数,可以使用 puppeteer 从网页获取内容。我希望能够经常检查网页,所以我尝试使用 setinterval 但我不断收到错误。有任何想法吗?