Puppeteer 如何检测URL列表中的重复值并停止迭代
我正在尝试使用Puppeteer 如何检测URL列表中的重复值并停止迭代,puppeteer,Puppeteer,我正在尝试使用puppeter和cron来抓取一个网站。它的工作正常,除了我不能想出如何停止程序执行,如果重复的url被检测到 以下是我的项目的伪代码: // target = grab the <a> tag from site // page.goto(target) // grab all data // save it to the file //target=从站点抓取标记 //第页转到(目标) //抓取所有数据 //将其保存到文件中 虽然这段代码运行正常,但当
puppeter
和cron
来抓取一个网站。它的工作正常,除了我不能想出如何停止程序执行,如果重复的url被检测到
以下是我的项目的伪代码:
// target = grab the <a> tag from site
// page.goto(target)
// grab all data
// save it to the file
//target=从站点抓取标记
//第页转到(目标)
//抓取所有数据
//将其保存到文件中
虽然这段代码运行正常,但当我在scheduler/cron上运行这段脚本时,我希望以某种方式检测源站点的标记是否已被刮除,并在每次运行cron函数时停止代码再次刮除旧链接并将重复数据保存到字段中
谢谢你抽出时间