@crawlee/puppeteerFunctionscreatePuppeteerRouterVersion: 3.3createPuppeteerRouter CallablecreatePuppeteerRouter<Context>(): RouterHandler<Context>Creates new Router instance that works based on request labels. This instance can then serve as a requestHandler of your PuppeteerCrawler. Defaults to the PuppeteerCrawlingContext. Serves as a shortcut for using Router.create<PuppeteerCrawlingContext>().import { PuppeteerCrawler, createPuppeteerRouter } from 'crawlee';const router = createPuppeteerRouter();router.addHandler('label-a', async (ctx) => { ctx.log.info('...');});router.addDefaultHandler(async (ctx) => { ctx.log.info('...');});const crawler = new PuppeteerCrawler({ requestHandler: router,});await crawler.run();Type parametersContext: PuppeteerCrawlingContext<Dictionary<any>, Context> = PuppeteerCrawlingContext<Dictionary<any>>Returns RouterHandler<Context>
Creates new Router instance that works based on request labels. This instance can then serve as a
requestHandler
of your PuppeteerCrawler. Defaults to the PuppeteerCrawlingContext.