you can have multiple pageHandlers using a router. this allows you to change which handler a page is processed by by setting the label property when enqueuing a link. heres an example
const crawlerConfig = new Configuration({
//config options
});
const router = createPlaywrightRouter();
router.addHandler(
'label1',
label1Handler,
);
router.addHandler(
'label2',
label2Handler,
);
router.addHandler(
'label3',
label3Handler,
);
const crawlerOptions: PlaywrightCrawlerOptions = {
requestHandler: router,
//crawler options
};
const crawler = new PlaywrightCrawler(crawlerOptions, crawlerConfig);
crawler.run([
{url: 'url1', label: 'label1'},
])