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

import { Actor } from 'apify';
import { CheerioCrawler } from 'crawlee';
// this is ESM project, and as such, it requires you to specify extensions in your relative imports
// read more about this here: https://nodejs.org/docs/latest-v18.x/api/esm.html#mandatory-file-extensions
import { router } from './routes.js';

await Actor.init();

const proxyConfiguration = await Actor.createProxyConfiguration();

const crawler = new CheerioCrawler({
    proxyConfiguration,
    requestHandler: router,
});

await crawler.run(['https://example.com']);

await 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

A short guide on how to create Actors using code templates: web scraper template

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.