.claude/skills/ts-crawlee/SKILL.md
Build reliable web scrapers and crawlers with Crawlee — Apify's open-source framework for structured web scraping. Use when someone asks to "scrape a website", "build a crawler", "Crawlee", "web scraping at scale", "scrape JavaScript-rendered pages", "crawl with Playwright/Puppeteer", or "extract data from websites reliably". Covers HTTP crawling, browser crawling, request queues, proxy rotation, and data export.
npx skillsauth add eliferjunior/Claude crawleeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Crawlee is a web scraping and crawling library that handles the hard parts — request queuing, retries, proxy rotation, browser fingerprinting, and rate limiting. Use Cheerio for fast HTML-only scraping or Playwright/Puppeteer for JavaScript-rendered pages. Built-in storage for datasets, request queues, and key-value stores. Scales from single pages to millions of URLs.
npm install crawlee playwright
npx playwright install chromium # Only for browser crawling
// scraper.ts — Fast scraping with Cheerio (no browser needed)
import { CheerioCrawler, Dataset } from "crawlee";
const crawler = new CheerioCrawler({
maxConcurrency: 10, // Parallel requests
maxRequestRetries: 3, // Retry failed requests
requestHandlerTimeoutSecs: 30,
async requestHandler({ request, $, enqueueLinks, pushData }) {
// $ is Cheerio — jQuery-like selector API
const title = $("h1").text().trim();
const price = $("[data-testid='price']").text().trim();
const description = $("meta[name='description']").attr("content");
// Save structured data
await pushData({
url: request.url,
title,
price,
description,
scrapedAt: new Date().toISOString(),
});
// Follow pagination links
await enqueueLinks({
selector: "a.next-page",
label: "LISTING",
});
},
// Handle different page types
async failedRequestHandler({ request }) {
console.error(`Failed: ${request.url} after ${request.retryCount} retries`);
},
});
// Start crawling
await crawler.run(["https://example-shop.com/products"]);
// Export data
const dataset = await Dataset.open();
await dataset.exportToCSV("products");
// browser-scraper.ts — Scrape JS-rendered pages with Playwright
import { PlaywrightCrawler } from "crawlee";
const crawler = new PlaywrightCrawler({
maxConcurrency: 5, // Fewer concurrent — browsers are heavy
headless: true,
launchContext: {
launchOptions: {
args: ["--disable-blink-features=AutomationControlled"],
},
},
async requestHandler({ page, request, pushData, enqueueLinks }) {
// Wait for dynamic content to load
await page.waitForSelector("[data-loaded='true']", { timeout: 10000 });
// Extract data using Playwright selectors
const items = await page.$$eval(".product-card", (cards) =>
cards.map((card) => ({
name: card.querySelector("h3")?.textContent?.trim(),
price: card.querySelector(".price")?.textContent?.trim(),
rating: card.querySelector(".stars")?.getAttribute("data-rating"),
}))
);
for (const item of items) {
await pushData({ ...item, sourceUrl: request.url });
}
// Scroll to load more (infinite scroll)
await page.evaluate(() => window.scrollTo(0, document.body.scrollHeight));
await page.waitForTimeout(2000);
// Click "Load More" if exists
const loadMore = page.locator("button:has-text('Load More')");
if (await loadMore.isVisible()) {
await loadMore.click();
await page.waitForLoadState("networkidle");
}
},
});
await crawler.run(["https://spa-example.com/products"]);
// proxy-scraper.ts — Rotate proxies to avoid blocking
import { CheerioCrawler, ProxyConfiguration } from "crawlee";
const proxyConfig = new ProxyConfiguration({
proxyUrls: [
"http://user:[email protected]:8080",
"http://user:[email protected]:8080",
"http://user:[email protected]:8080",
],
});
const crawler = new CheerioCrawler({
proxyConfiguration: proxyConfig,
// Crawlee automatically rotates and retires failing proxies
async requestHandler({ request, $, pushData, proxyInfo }) {
console.log(`Using proxy: ${proxyInfo?.url}`);
// ... scraping logic
},
});
User prompt: "Scrape all product names, prices, and ratings from example-shop.com and export to CSV."
The agent will create a CheerioCrawler with pagination handling, structured data extraction, and CSV export.
User prompt: "Build a daily scraper that checks competitor prices and alerts when they change."
The agent will create a PlaywrightCrawler for JS-rendered pages, store prices in a dataset, compare with previous runs, and send alerts on changes.
enqueueLinks for crawling — automatically follows and deduplicates linkspushData for structured output — builds a dataset that exports to CSV/JSONrobotsTxtUrl in crawler configmaxRequestsPerMinute to avoid overwhelming targetsfailedRequestHandler catches and logs failed URLsdevelopment
Expert guidance for Fireworks AI, the platform for running open-source LLMs (Llama, Mixtral, Qwen, etc.) with enterprise-grade speed and reliability. Helps developers integrate Fireworks' inference API, fine-tune models, and deploy custom model endpoints with function calling and structured output support.
development
Convert any website into clean, structured data with Firecrawl — API-first web scraping service. Use when someone asks to "turn a website into markdown", "scrape website for LLM", "Firecrawl", "extract website content as clean text", "crawl and convert to structured data", or "scrape website for RAG". Covers single-page scraping, full-site crawling, structured extraction, and LLM-ready output.
tools
Expert guidance for Firebase, Google's platform for building and scaling web and mobile applications. Helps developers set up authentication, Firestore/Realtime Database, Cloud Functions, hosting, storage, and analytics using Firebase's SDK and CLI.
development
When the user needs to build file upload functionality for a web application. Use when the user mentions "file upload," "image upload," "upload endpoint," "multipart upload," "presigned URL," "S3 upload," "file validation," "upload to cloud storage," or "accept user files." Handles upload endpoints, file validation (type, size, magic bytes), cloud storage integration, and upload status tracking. For image/video processing after upload, see media-transcoder.