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