Back to template gallery

Bootstrap CheerioCrawler

Skeleton project that helps you quickly bootstrap `CheerioCrawler` in JavaScript. It's best for developers who already know Apify SDK and Crawlee.

Language

javascript

Tools

nodejs

crawlee

cheerio

Use cases

Web scraping

src/main.js

src/routes.js

1import { Actor } from 'apify';
2import { CheerioCrawler } from 'crawlee';
3// this is ESM project, and as such, it requires you to specify extensions in your relative imports
4// read more about this here: https://nodejs.org/docs/latest-v18.x/api/esm.html#mandatory-file-extensions
5import { router } from './routes.js';
6
7await Actor.init();
8
9const proxyConfiguration = await Actor.createProxyConfiguration();
10
11const crawler = new CheerioCrawler({
12    proxyConfiguration,
13    requestHandler: router,
14});
15
16await crawler.run(['https://example.com']);
17
18await Actor.exit();

Bootstrap CheerioCrawler template

This is a project skeleton to help you bootstrap CheerioCrawler web scraping projects in JavaScript faster. It will always use the most up-to-date configuration and include all the common files. It's made for developers already familiar with Apify SDK and Crawlee libraries.

If you're looking for examples or want to learn how to use Apify, Apify SDK, or Crawlee, check out the other templates.

Resources

Already have a solution in mind?

Sign up for a free Apify account and deploy your code to the platform in just a few minutes! If you want a head start without coding it yourself, browse our Store of existing solutions.