Skip to main content
Version: 3.1

Crawl a sitemap

This example downloads and crawls the URLs from a sitemap.

Using CheerioCrawler:

Run on
import { Actor } from 'apify';
import { CheerioCrawler, downloadListOfUrls } from 'crawlee';

await Actor.init();

const crawler = new CheerioCrawler({
// Function called for each URL
async requestHandler({ request }) {
maxRequestsPerCrawl: 10, // Limitation for only 10 requests (do not use if you want to crawl a sitemap)

const listOfUrls = await downloadListOfUrls({ url: '' });

// Run the crawler

await Actor.exit();