Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.
TypeScript apifyautomationcrawlercrawlingheadlessheadless-chromejavascriptnodejsnpmplaywrightpuppeteerscraperscrapingtypescriptweb-crawlerweb-crawlingweb-scraping
import { Actor } from 'apify';
import { CheerioCrawler } from 'crawlee';
await Actor.main(async () => {
const crawler = new CheerioCrawler({
async requestHandler({ request, $, enqueueLinks }) {
const { url } = request;
// Extract HTML title of the page.
const title = $('title').text();
console.log(`Title of ${url}: ${title}`);
// Add URLs that match the provided pattern.
await enqueueLinks({
include: ['https://www.iana.org/*'],
});
// Save extracted data to dataset.
await Actor.pushData({ url, title });
},
});
// Enqueue the initial request and run the crawler
await crawler.run(['https://www.iana.org/']);
});