Files
apify--crawlee/docs/examples/crawl_multiple_urls_cheerio.ts
2026-07-13 13:23:39 +08:00

13 lines
435 B
TypeScript

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']);