
PyScrappy
AI-native web scraping toolkit + MCP server
Replaces Firecrawl, Scraperapi, Bright Data

Who it's for
PyScrappy converts any public web page to clean markdown or JSON in one API call, removing the HTML noise that degrades embedding quality. The batch crawl API lets you queue thousands of URLs and pull results asynchronously, which fits standard ETL pipelines. Built-in scrapers for Wikipedia, GitHub, news feeds, and documentation sites return pre-structured data. Use the MCP server mode to let AI agents scrape web data on demand during inference.
Your dataset sources are already in structured formats (RSS, sitemaps, public APIs). PyScrappy's value is extracting from unstructured HTML. If your sources do not require it, a lightweight HTTP client is simpler.
Teams currently paying $300+/month for ScraperAPI or Diffbot can self-host PyScrappy and eliminate recurring API costs. The adaptive selectors reduce maintenance overhead compared to custom scripts that break on every site update. Built-in scrapers for stock data, e-commerce (Amazon, IKEA, Newegg), and news feeds handle common use cases without writing custom parsers. DataFrame output integrates directly into pandas-based analysis workflows.
You need entity extraction (people, companies, products) from unstructured text. Diffbot's structured entity API is more advanced than PyScrappy's text extraction. PyScrappy gives you clean markdown and JSON; you handle entity recognition separately.
The MCP server exposes all 24 scrapers as tools for Claude, Cursor, or any MCP-compatible agent. An agent can call scrape_wikipedia, scrape_stock, or scrape_url naturally and receive structured data back without the developer writing scraper code. For local models (Ollama), the built-in pyscrappy chat agent lets models that support tool calling (Llama 3.1, Qwen 2.5, Mistral) use the same scrapers directly.
Your AI agent workflow does not need live web data at inference time. If you pre-fetch and embed all sources offline, the MCP server adds unnecessary runtime complexity. Use the Python library in your data pipeline instead.
The adaptive selector system reduces the maintenance burden for long-lived scrapers. When a site redesigns and breaks a CSS selector, PyScrappy relocates the element by structural and textual similarity instead of returning empty. The confidence score tells you how certain the relocation was. For sites that change markup frequently, this is more reliable than hard-coded selectors that silently break.
You are scraping APIs or structured feeds (JSON, XML, RSS) where selectors are not needed. Adaptive selectors solve a problem that only exists when parsing unstructured HTML.
The problem
Web scraping at production scale faces three major pain points. First, brittle selectors: custom scrapers break silently every time a site updates its HTML structure, requiring constant maintenance and monitoring. Second, anti-bot blocking: many sites detect standard HTTP clients by their TLS fingerprints and serve CAPTCHA challenges or error pages before you see any content. Third, cost at scale: commercial scraping APIs like Diffbot, ScraperAPI, and ScrapeOps charge per-page fees that range from $299 to over $1,000 per month for anything beyond toy projects. The output quality problem compounds these issues. Raw HTML from dynamic JavaScript sites requires extensive cleaning before it is usable for AI training or RAG pipelines. Most scraping libraries return unstructured markup that needs a separate parsing and normalization step. For teams building LLM-powered systems, this preprocessing overhead adds latency and fragility to the data pipeline.
How it works
CSS selectors that remember an element's structural fingerprint and relocate it by similarity when a site changes its markup, so scrapers do not silently break after a redesign. The system uses weighted signals (stable id/data attributes count more than sibling order) and volatility-aware text matching (prices and dates are down-weighted). Confidence scores (0-100) tell you how certain the relocation was. Fingerprints persist in a local JSON store namespaced by site.
Bypass anti-bot systems that block plain HTTP clients by mimicking a real browser's TLS/JA3 fingerprint. Set impersonate="chrome" to pass TLS-level detection without running a headless browser. Supports Chrome, Firefox, and Safari fingerprints via the optional curl_cffi backend. Works on the synchronous path; async clients raise a clear error if you set this option.
Every scrape result converts to clean markdown (.to_markdown()), structured JSON (.to_json()), or pandas DataFrame (.to_dataframe()) with one method call. Markdown output strips HTML noise and preserves semantic structure (headings, lists, tables, links) for direct embedding or LLM context. JSON output is typed and validated. No separate parsing step needed.
Pre-built scrapers for Wikipedia, GitHub, IMDB, stock quotes (Yahoo Finance), news feeds (RSS/Atom), YouTube, Amazon, IKEA, Newegg, Hacker News, LinkedIn jobs, weather, crypto, currency, dictionaries, and more. Each scraper returns structured data in the same ScrapeResult format. GenericScraper handles any URL with auto-extraction of text, links, images, tables, and metadata.
Run PyScrappy as a Model Context Protocol server that exposes all 24 scrapers as tools for AI agents (Claude, Cursor, local LLMs via Ollama). Agents call scrape_url, scrape_wikipedia, scrape_stock, or search_github as tools and receive structured markdown or JSON back. For local models that lack MCP support, the built-in pyscrappy chat agent talks to Ollama directly and exposes the same 22 tools.
Optional Playwright backend for sites that require a browser to render. Scrapes React, Vue, and Angular SPAs by running headless Chromium server-side, so you get the same DOM state a real visitor would see. No Puppeteer or Playwright setup needed on the caller side. Install with pip install 'pyscrappy[browser]' and playwright install chromium.
Features
- Adaptive self-healing selectors
- TLS-fingerprint impersonation (stealth mode)
- LLM-ready output formats
- 24 built-in scrapers for common platforms
- MCP server for AI agents
- JavaScript rendering with Playwright
How to install
PyScrappy requires Python 3.9 or newer. The core library installs via pip with no external dependencies. Optional extras add browser support (Playwright), MCP server capabilities (Python 3.10+ required), stealth mode (TLS impersonation), and DataFrame output.
# Core library (static HTML scraping, no browser)
pip install pyscrappy
# With browser support for JavaScript-rendered pages
pip install 'pyscrappy[browser]'
playwright install chromium
# With MCP server for AI agents (Python 3.10+)
pip install 'pyscrappy[mcp]'
# With stealth mode (TLS-fingerprint impersonation)
pip install 'pyscrappy[stealth]'
# Everything
pip install 'pyscrappy[all]'For self-hosting in production, run the core library on any Python 3.9+ environment. If you need JavaScript rendering, provision at least 2GB RAM per concurrent worker for headless Chromium. Deploy the MCP server with pyscrappy-mcp (stdio by default) or pyscrappy-mcp --http for remote HTTP deployments. Register with Claude Code using claude mcp add pyscrappy pyscrappy-mcp. For Claude Desktop, add the server to your claude_desktop_config.json under mcpServers.
Recommended for this setup
Strengths
- MIT license with full self-hosting: The entire toolkit is MIT licensed, so you can run it on your infrastructure, modify scrapers, and use it commercially without restrictions. Unlike Diffbot (API-only, per-page billing) or ScraperAPI (managed proxy service with usage tiers), you pay once for the server and own the pipeline. For teams scraping more than a few thousand pages per month, this eliminates recurring API costs entirely.
- Self-healing selectors survive redesigns: Adaptive selectors are a genuine innovation over traditional CSS or XPath scrapers. Hard-coded selectors break silently the day a site changes its markup. PyScrappy's fingerprint-based relocation uses weighted structural signals (stable ids and data attributes count more than tag order) and volatility-aware text matching (prices and dates are down-weighted) to find the element again. This reduces maintenance overhead for long-lived scrapers.
- Zero external dependencies for basic scraping: The core library works with Python 3.9+ and standard HTTP clients, with no required external services or databases. Optional extras (browser support, MCP server, stealth mode, DataFrame output) are truly optional. You can install the base package, write a scraper, and run it on any Python environment without configuring a headless browser or proxy service first.
- Concurrent scraping with built-in rate limiting: scrape_many and scrape_all run scrapes in parallel with exponential backoff retries and per-domain rate limiting built in. You pass a list of URLs and get back results as they complete, with failed requests automatically retried up to max_retries times. This is faster than sequential scraping and safer than naive threading without rate limits.
Trade-offs
- JavaScript rendering requires 2GB+ RAM per worker: The Playwright backend runs headless Chromium, which needs at least 2GB RAM per concurrent worker. Lightweight VPS deployments under 1GB will hit out-of-memory errors on JavaScript-heavy sites. You can run the core library (static HTML scraping) on minimal resources, but dynamic SPAs require a beefier server or cloud deployment. This is not unique to PyScrappy (all browser-based scrapers have this cost), but it is a real constraint.
- No hosted option or managed service: PyScrappy is self-hosted only. There is no official managed API or cloud service, so you provision and maintain your own infrastructure. Commercial services like Diffbot or ScraperAPI handle proxy rotation, anti-bot challenges, and infrastructure scaling for you. With PyScrappy, you handle those yourself (or use a third-party proxy service, which the library supports). This tradeoff makes sense for cost-sensitive or privacy-focused teams, but adds operational overhead.
- Some built-in scrapers need proxies for blocked sites: A few built-in scrapers (Instagram, Twitter, Spotify, eBay) are marked as needing a proxy because those sites aggressively block automated requests. PyScrappy supports proxy configuration and scraping-API services (ScraperAPI, ScrapeOps, ScrapingBee) to route through, but you pay for those separately. The README is honest about which scrapers work without a proxy and which do not.
Tech stack
FAQ
Yes. PyScrappy is MIT licensed and free to run on your own infrastructure. There is no managed cloud API or paid tier. The entire toolkit, including the MCP server and all 24 built-in scrapers, is open source. You pay for your own server or cloud compute, but there are no per-request fees or usage limits beyond what your infrastructure can handle.
Yes. PyScrappy ships an optional MCP (Model Context Protocol) server that exposes all scrapers as tools for AI agents. Install with pip install 'pyscrappy[mcp]' (requires Python 3.10+), run pyscrappy-mcp or python -m pyscrappy.mcp, and register it with your agent's MCP config. For Claude Desktop, add the server to claude_desktop_config.json. For Claude Code, run claude mcp add pyscrappy pyscrappy-mcp. The agent can then call scrape_url, scrape_wikipedia, scrape_stock, and 20+ other tools naturally.
PyScrappy has three anti-bot strategies. First, TLS-fingerprint impersonation (stealth mode): set impersonate="chrome" to mimic a real browser's TLS/JA3 fingerprint and bypass detection at the TLS handshake layer, before the site serves a CAPTCHA. Requires the optional stealth extra (pip install 'pyscrappy[stealth]'). Second, proxy support: route requests through a proxy or rotating proxy list. Third, scraping-API integration: configure ScraperAPI, ScrapeOps, or ScrapingBee to handle proxies and anti-bot challenges for you. Some built-in scrapers (Instagram, Twitter, Spotify) are marked as needing a proxy because those sites block aggressively.
Diffbot and ScraperAPI are managed cloud APIs with per-page billing ($299+/month for production workloads). PyScrappy is self-hosted and MIT licensed, so you run it on your infrastructure with zero per-request costs after setup. Diffbot offers advanced entity extraction (people, companies, products) from unstructured text; PyScrappy focuses on clean text/JSON/markdown extraction and leaves entity recognition to your LLM or separate NLP pipeline. ScraperAPI is a proxy service that handles anti-bot challenges; PyScrappy includes TLS impersonation and proxy support, but you manage the infrastructure. PyScrappy is the better choice when you need cost control, data privacy, or the ability to modify the extraction pipeline.
No, not for most sites. The core library scrapes static HTML with standard HTTP clients and no browser required. You only need the optional Playwright backend (pip install 'pyscrappy[browser]' and playwright install chromium) if you are scraping JavaScript-rendered single-page apps (React, Vue, Angular). Sites that serve full HTML on the initial request work fine without a browser. The README's GenericScraper supports both modes: it auto-detects when JavaScript rendering is needed, or you can force it with render_js=True.