Scrapy
$ scrapy Official Med RiskScrapy (scrapy) is a mature, extensible Python crawling and scraping CLI featuring scrapy crawl with built-in JSON/JSONL/CSV feed exports (-O out.json), scrapy runspider for single-file spiders, scrapy fetch, and an interactive scrapy shell for CSS/XPath selector debugging.
pip install Scrapy Executes asynchronous Twisted-based spider pipelines and structured feed exports locally; orthogonal to interactive MCP browsers.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports -O out.json/out.jsonl, --nolog, and -s inline settings overrides, though scrapy shell is interactive and logs go to stderr.
- Built-in
-Ofeed export (json,jsonlines,csv) and--nolog
Respects robots.txt when configured, supports AUTOTHROTTLE_ENABLED and CLOSESPIDER_PAGECOUNT caps, and writes only local feed files.
- Built-in
ROBOTSTXT_OBEY, AutoThrottle, andCLOSESPIDER_*bounds
Cross-platform via PyPI/conda, though compiling C extensions (lxml, cryptography) on minimal OSes can require build tools.
- Available via
pip install Scrapyacross macOS, Linux, Windows
Full async crawling engine with CSS/XPath selectors, item pipelines, retries, and caching out of the box.
- Async Twisted engine with built-in selectors and feed exporters
Long-standing official open-source framework (scrapy/scrapy) under BSD-3-Clause with active maintenance.
- Mature BSD-3-Clause project with regular releases
Extensive official documentation (docs.scrapy.org) covering CLI commands, settings, and feed exports.
- Comprehensive CLI and settings reference at
docs.scrapy.org
Security, Auth & Guardrails
Project settings and optional proxy/API credentials live in settings.py or env vars read by user spider code.
Free, BSD-3-Clause open-source Python package.
# Scrapy Agent Rules - Never run `scrapy shell` (interactive REPL) inside headless agent shells. - Prefer `-O <file>.json` (overwrite) or `.jsonl` over `-o` (append, which produces invalid JSON). - Respect `ROBOTSTXT_OBEY=True` and set `-s CLOSESPIDER_PAGECOUNT=<n>` to bound crawls.
Agent-Ready Command Recipes
Safe Read-Only Queries
scrapy runspider spider.py -O items.json --nolog
Executes spider.py non-interactively with --nolog and overwrites items.json cleanly.
scrapy fetch --nolog https://example.com
Downloads a single page's HTML to stdout without project scaffolding or log noise.
Controlled Writes & Previews
scrapy crawl myspider -O out.jsonl -s CLOSESPIDER_PAGECOUNT=50
Runs myspider capped at 50 pages and writes clean JSON Lines to out.jsonl.
Strengths for Agents
- +
-O out.jsonland-ssetting overrides enable deterministic, bounded batch scraping. - + Built-in
CLOSESPIDER_PAGECOUNTandAUTOTHROTTLE_ENABLEDguard against runaway crawls.
Caveats & Pitfalls
- ! Using lowercase
-oon.jsonfiles appends root objects and creates malformed JSON; use-Oor.jsonl. - ! Static HTTP downloader by default; JS-heavy SPAs require plugins like
scrapy-playwright.