Skip to main content
Version: Next

Crawl multiple URLs

This example crawls the specified list of URLs.

Run on
import { CheerioCrawler } from 'crawlee';

const crawler = new CheerioCrawler({
// Function called for each URL
async requestHandler({ request, $, log }) {
const title = $('title').text();
log.info(`URL: ${request.url}\nTITLE: ${title}`);
},
});

// Run the crawler with initial request
await crawler.run(['http://www.example.com/page-1', 'http://www.example.com/page-2', 'http://www.example.com/page-3']);