Labsco
brettdavies logo

Crawl4AI

β˜… 38

from brettdavies

Web scraping skill for Claude AI. Crawl websites, extract structured data with CSS/LLM strategies, handle dynamic JavaScript content. Built on crawl4ai with complete SDK reference, example scripts, and tests.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup

Crawl4AI Agent Skill

Scrape JavaScript-heavy sites and extract structured data via reusable CSS schemas. A portable agent skill that wraps the Crawl4AI CLI and Python SDK, written in the Anthropic SKILL.md format and consumable by any agent host that loads SKILL.md-format bundles (Claude Code, Codex, Cursor, OpenCode, Cline, and others).

Verified against Crawl4AI library version 0.8.9 (pinned in VERSION).

Features

  • JS-aware crawling: full headless-browser rendering with wait_until=networkidle defaults
  • Schema-based extraction: derive a CSS selector schema once via LLM, apply it forever with no further LLM cost
  • LLM extraction: per-request structured extraction when a schema is not worth deriving
  • Content filtering: BM25 relevance filter and quality-based pruning, plain markdown or markdown-fit output
  • Concurrent batch crawling: multi-URL processing with per-job concurrency caps
  • Session management: persistent sessions for authenticated, multi-step flows
  • CLI and SDK: both the crwl command-line tool and the crawl4ai Python SDK

Bundle layout

PathContents
SKILL.mdEntry point: trigger conditions, defaults, routing to specialized pipelines
references/Nine reference guides for CLI, SDK, extraction, filtering, anti-detection, URL discovery, escalation
scripts/Six PEP 723 helper scripts for crawl / extract / batch workflows
templates/Reusable YAML/JSON templates for browser, crawler, filters, and extraction strategies
evals/Four eval scenarios for verifying skill behavior end-to-end
fixtures/Schema-generation reference fixture (sample HTML, expected schema, expected JSON output)
tests/Pytest suite covering basic crawling, markdown generation, extraction, advanced patterns, and fixtures
VERSIONPinned Crawl4AI library version the skill is verified against
LICENSE-APACHE, LICENSE-MIT, LICENSEDual license texts and summary (SPDX MIT OR Apache-2.0)

Documentation

Common use cases

Documentation to markdown

Copy & paste β€” that's it
crwl https://docs.example.com -o markdown > docs.md

E-commerce product monitoring

Copy & paste β€” that's it
# Derive the schema once (uses LLM)
./scripts/generate_schema.py https://shop.example.com "products with name, price, image" shop_schema.json

# Apply the saved schema (no LLM cost per request)
./scripts/extract_with_schema.py https://shop.example.com shop_schema.json products.json

News aggregation with relevance filtering

Copy & paste β€” that's it
for url in news1.com news2.com news3.com; do
  crwl "https://$url" -f templates/filter_bm25.yml -o markdown-fit
done

Scripts

ScriptPurpose
scripts/basic_crawler.py <url>One URL β†’ markdown + screenshot
scripts/batch_crawl.py <urls.txt>Many URLs β†’ markdown files
scripts/batch_extract.py <urls.txt> <schema.json>Many URLs + schema β†’ JSON
scripts/generate_schema.py <url> "<instruction>"Derive a reusable CSS schema (one-time LLM call)
scripts/extract_with_schema.py <url> <schema.json>Apply a saved schema (no LLM)
scripts/extract_with_llm.py <url> "<instruction>"Per-request LLM extraction (expensive; one-off only)

Testing

Copy & paste β€” that's it
cd tests
python run_all_tests.py

License

Dual-licensed under Apache License 2.0 (LICENSE-APACHE) or MIT License (LICENSE-MIT) at your option. SPDX identifier: MIT OR Apache-2.0. See LICENSE for the full notice.

Contributing

Contributions welcome. Open a pull request.

Changelog

See CHANGELOG.md.