我有一些链接。我想同时访问3个链接并抓取数据。因此会一次打开3个铬标签。
现在我的问题是我在哪里使用scraperQueue.process worker。
async naviageAndScrape() {
this.log("naviagating single profile...");
for (let link of this.links) {
try {
scraperQueue.add({ link });
await this.scrapeActualData(link);
} catch (err) {
console.log(err);
}
}
}
实际上正在刮擦。
await this.navigate(link);
await this.log("extracting public profile...");
const profiledetails = await this.page.evaluate(this.getDetails);
profileStore.union("profile", profiledetails);
}