Scrapling: An Adaptive Web Scraping Framework
Scrapling is a Python scraping framework built around one idea: selectors that survive a site redesign, not just ones that work today. Its parser relocates elements automatically when a page's HTML changes, which is the actual failure mode Scrapy and BeautifulSoup never solved. If your scrapers keep breaking on markup changes, this fixes exactly that - it isn't trying to replace everything else in your stack.
What Is Scrapling?
Scrapling is an open-source Python framework for web scraping that combines request fetching, browser automation, and HTML parsing in one library. It ships three fetcher types - a plain HTTP Fetcher, a StealthyFetcher for anti-bot sites, and a DynamicFetcher for full browser automation - plus a Scrapy-style Spider class for concurrent, resumable crawls.
Key Features
- ✓Three fetcher classes for different jobs: Fetcher for plain HTTP with TLS/header impersonation, StealthyFetcher for Cloudflare Turnstile and other anti-bot walls, and DynamicFetcher for full Playwright/Chrome automation.
- ✓Adaptive element tracking - the parser remembers an element's context and relocates it by similarity after a site's HTML changes, instead of just failing the selector.
- ✓A Scrapy-like Spider class with concurrent requests, per-domain throttling, AutoThrottle delay tuning, and checkpoint-based pause/resume via Ctrl+C.
- ✓Built-in proxy rotation, DNS-over-HTTPS to avoid DNS leaks behind a proxy, and the option to connect to a remote browser over CDP instead of launching one locally.
- ✓Background XHR/fetch capture (capture_xhr) that grabs a page's own API responses while it loads, so you don't have to reverse-engineer the network calls yourself.
- ✓An MCP server for AI coding agents (Claude, Cursor) that extracts targeted content before handing it to the model, plus an Agent Skill that teaches the current API.
- ✓CSS, XPath, filter-based, text, and regex selection on the same parser, with a find_similar() method for locating elements like one you already found.
- ✓A CLI (scrapling extract, scrapling shell) for pulling a page to .txt/.md/.html without writing a script, including a curl-to-Scrapling converter in the shell.
What Can You Build With Scrapling?
- •Price and inventory monitors that keep working after a retailer redesigns its product pages, because the adaptive selectors relocate the price and stock fields instead of returning None.
- •Full-site crawls behind Cloudflare Turnstile using StealthyFetcher, with proxy rotation and AutoThrottle so you don't get blocked mid-crawl.
- •A Shopify catalog puller via the ready-made ShopifySpider template - one run pulls every product and variant through the store's own JSON API.
- •Long-running crawls you can pause with Ctrl+C and resume later from a checkpoint directory, useful for jobs that outlive a single work session.
- •An MCP-connected scraping backend for an AI coding agent, so the agent gets pre-extracted page content instead of burning tokens on raw HTML.
Installing Scrapling
Scrapling requires Python 3.10 or higher. Install the base library with pip install scrapling. The README notes that this base install only includes the parser engine and its dependencies, not the fetchers - the exact extras/browser-install step is not clearly documented in what's provided here, so check the docs site linked from the repo before you reach for StealthyFetcher or DynamicFetcher for the first time.
Basic Scrapling Usage
Basic usage is import-and-call. A one-off GET: ```python from scrapling.fetchers import Fetcher page = Fetcher.get('https://quotes.toscrape.com/') quotes = page.css('.quote .text::text').getall() ``` For anti-bot sites, swap the fetcher and add `adaptive=True` so selectors survive later markup changes: ```python from scrapling.fetchers import StealthyFetcher page = StealthyFetcher.fetch('https://example.com', headless=True) products = page.css('.product', adaptive=True) ``` For a real crawl, subclass `Spider`, list `start_urls`, and yield items from an async `parse()`: ```python from scrapling.spiders import Spider, Response class MySpider(Spider): name = "demo" start_urls = ["https://example.com/"] async def parse(self, response: Response): for item in response.css('.product'): yield {"title": item.css('h2::text').get()} MySpider().start() ```
Strengths
- ✓One library instead of three - HTTP fetching, stealthy browser fetching, and parsing usually mean stitching together requests, Playwright, and BeautifulSoup yourself; Scrapling ships all three with one selector API across them.
- ✓The adaptive relocation is a real, specific mechanism, not marketing language - it stores element context and finds it again by similarity, which is a genuine answer to the 'scraper broke because of a CSS class rename' problem.
- ✓Pause/resume via checkpoints means a multi-hour crawl surviving a Ctrl+C or a crashed process, rather than restarting from URL zero.
- ✓Drop-in Scrapy integration (scrapling_response decorator) means teams with an existing Scrapy codebase can adopt Scrapling's parser without a rewrite.
Scrapling Limitations
- △The base pip install scrapling only ships the parser - the README's own installation section cuts off explaining what the fetcher extras require, so budget time to find the right install flags instead of assuming one command gets you everything.
- △StealthyFetcher and DynamicFetcher depend on a real browser (Playwright/Chrome), which means the usual browser-automation weight: larger Docker images, more memory, slower cold starts than a plain HTTP fetcher.
- △Adaptive element tracking works from stored similarity data (auto_save=True) captured on a prior run - if you never saved a baseline, there's nothing for adaptive=True to relocate against.
- △The Spider framework is new enough that its API (session routing by sid, configure_sessions) is still less battle-tested in the wild than Scrapy's, which has had the equivalent surface for over a decade.
Scrapling Alternatives
Frequently Asked Questions
Scrapling is released under the BSD-3-Clause license, which permits commercial use, modification, and redistribution without paying for a license - you only need to keep the copyright notice intact.
Scrapling's StealthyFetcher uses fingerprint spoofing and stealth browser automation to get past Cloudflare's Turnstile and Interstitial challenges, letting a scrape complete the way a real browser session would instead of getting blocked outright.
Fetcher sends plain HTTP requests with browser-like TLS and header impersonation. StealthyFetcher adds anti-bot stealth and can bypass Cloudflare Turnstile. DynamicFetcher drives a full Playwright or Chrome browser for pages that need real JavaScript execution.
Scrapling's Spider framework supports pause and resume: checkpointed progress is saved to disk, Ctrl+C triggers a graceful shutdown, and restarting the spider with the same crawldir continues the crawl from where it stopped.
Scrapling's parser stores context about an element - its tag, attributes, text, and position - the first time you scrape it with auto_save=True. When you later query with adaptive=True, it uses similarity matching against that saved context to relocate the element even after the site's HTML structure changes.
Scrapling has async support across all its fetchers and session classes - AsyncFetcher, async Spider callbacks, and dedicated async session types like AsyncStealthySession - so concurrent crawling and parallel requests work with standard asyncio/await code.
The problem it solves
Scrapers written against a site's current CSS classes and XPath paths break the moment that site redesigns its markup - dev teams then spend hours re-inspecting the DOM and patching selectors one by one. Scrapling's adaptive parser fingerprints an element's context (tag, attributes, text, position) once, then relocates it after the page changes, so the same selector call keeps returning the same logical field instead of an empty result.
Who should try it — and who should skip
Try Scrapling if you're maintaining scrapers against sites that change their markup often, or you're fighting Cloudflare Turnstile with a bare requests+BeautifulSoup setup and losing. It also makes sense for anyone building an MCP-connected scraping backend for a coding agent - that's a specific niche this library covers that Scrapy doesn't. Skip it if you have a working Scrapy pipeline with custom middlewares already in production; the migration cost likely outweighs what adaptive selectors buy you, and Scrapling's own Spider API borrows from Scrapy rather than replacing the ecosystem around it.
Related repositories
Curious whether Scrapling is right for you?
Let ChatGPT, Claude, or Perplexity look into it — click below and see what AI actually says about Scrapling.
