#mixed headful and headless in a PlaywrightCrawler
1 messages · Page 1 of 1 (latest)
Hi @peak osprey I am no sure if I understand. First of all how would you like to "confirm it"? You may want to run two crawlers - one with headfull mode and the second one in headless mode. In the first crawler you may set a countrer for requests being done and abort it once these requests are proceeded.
router.addHandler('detail', async ({ request, page, log, crawler }) => {
const title = await page.title();
console.log(i);
if (i++ > 1) {
await crawler.autoscaledPool.abort();
// crawler.headless = true;
}
log.info(`${title}`, { url: request.loadedUrl });
await Dataset.pushData({
url: request.loadedUrl,
title,
});
});
Then the second crawler starts up and continues in the headlesss mode.
other way is use two request queues
the headless option is related to Crawler not a Request. You may simple run into issues by reusing one actor twice.