Index
Effortless Web Scraping for the Modern Web
Scrapling is an adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl.
Its parser learns from website changes and automatically relocates your elements when pages update. Its fetchers bypass anti-bot systems like Cloudflare Turnstile out of the box. And its spider framework lets you scale up to concurrent, multi-session crawls with pause/resume and automatic proxy rotation β all in a few lines of Python. One library, zero compromises.
Blazing fast crawls with real-time stats and streaming. Built by Web Scrapers for Web Scrapers and regular users, there's something for everyone.
from scrapling.fetchers import Fetcher, StealthyFetcher, DynamicFetcher
StealthyFetcher.adaptive = True
page = StealthyFetcher.fetch('https://example.com', headless=True, network_idle=True) # Fetch website under the radar!
products = page.css('.product', auto_save=True) # Scrape data that survives website design changes!
products = page.css('.product', adaptive=True) # Later, if the website structure changes, pass `adaptive=True` to find them!
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()
Top Sponsors¶
Do you want to show your ad here? Click here, choose a plan, and enjoy the rest of the perks!
Key Features¶
Spiders β A Full Crawling Framework¶
- π·οΈ Scrapy-like Spider API: Define spiders with
start_urls, asyncparsecallbacks, andRequest/Responseobjects. - β‘ Concurrent Crawling: Configurable concurrency limits, per-domain throttling, and download delays.
- π Multi-Session Support: Unified interface for HTTP requests, and stealthy headless browsers in a single spider β route requests to different sessions by ID.
- πΎ Pause & Resume: Checkpoint-based crawl persistence. Press Ctrl+C for a graceful shutdown; restart to resume from where you left off.
- π‘ Streaming Mode: Stream scraped items as they arrive via
async for item in spider.stream()with real-time stats β ideal for UI, pipelines, and long-running crawls. - π‘οΈ Blocked Request Detection: Automatic detection and retry of blocked requests with customizable logic.
- π¦ Built-in Export: Export results through hooks and your own pipeline or the built-in JSON/JSONL with
result.items.to_json()/result.items.to_jsonl()respectively.
Advanced Websites Fetching with Session Support¶
- HTTP Requests: Fast and stealthy HTTP requests with the
Fetcherclass. Can impersonate browsers' TLS fingerprint, headers, and use HTTP/3. - Dynamic Loading: Fetch dynamic websites with full browser automation through the
DynamicFetcherclass supporting Playwright's Chromium and Google's Chrome. - Anti-bot Bypass: Advanced stealth capabilities with
StealthyFetcherand fingerprint spoofing. Can easily bypass all types of Cloudflare's Turnstile/Interstitial with automation. - Session Management: Persistent session support with
FetcherSession,StealthySession, andDynamicSessionclasses for cookie and state management across requests. - Proxy Rotation: Built-in
ProxyRotatorwith cyclic or custom rotation strategies across all session types, plus per-request proxy overrides. - Domain Blocking: Block requests to specific domains (and their subdomains) in browser-based fetchers.
- Async Support: Complete async support across all fetchers and dedicated async session classes.
Adaptive Scraping & AI Integration¶
- π Smart Element Tracking: Relocate elements after website changes using intelligent similarity algorithms.
- π― Smart Flexible Selection: CSS selectors, XPath selectors, filter-based search, text search, regex search, and more.
- π Find Similar Elements: Automatically locate elements similar to found elements.
- π€ MCP Server to be used with AI: Built-in MCP server for AI-assisted Web Scraping and data extraction. The MCP server features powerful, custom capabilities that leverage Scrapling to extract targeted content before passing it to the AI (Claude/Cursor/etc), thereby speeding up operations and reducing costs by minimizing token usage. (demo video)
High-Performance & battle-tested Architecture¶
- π Lightning Fast: Optimized performance outperforming most Python scraping libraries.
- π Memory Efficient: Optimized data structures and lazy loading for a minimal memory footprint.
- β‘ Fast JSON Serialization: 10x faster than the standard library.
- ποΈ Battle tested: Not only does Scrapling have 92% test coverage and full type hints coverage, but it has been used daily by hundreds of Web Scrapers over the past year.
Developer/Web Scraper Friendly Experience¶
- π― Interactive Web Scraping Shell: Optional built-in IPython shell with Scrapling integration, shortcuts, and new tools to speed up Web Scraping scripts development, like converting curl requests to Scrapling requests and viewing requests results in your browser.
- π Use it directly from the Terminal: Optionally, you can use Scrapling to scrape a URL without writing a single line of code!
- π οΈ Rich Navigation API: Advanced DOM traversal with parent, sibling, and child navigation methods.
- 𧬠Enhanced Text Processing: Built-in regex, cleaning methods, and optimized string operations.
- π Auto Selector Generation: Generate robust CSS/XPath selectors for any element.
- π Familiar API: Similar to Scrapy/BeautifulSoup with the same pseudo-elements used in Scrapy/Parsel.
- π Complete Type Coverage: Full type hints for excellent IDE support and code completion. The entire codebase is automatically scanned with PyRight and MyPy with each change.
- π Ready Docker image: With each release, a Docker image containing all browsers is automatically built and pushed.
Star History¶
Scraplingβs GitHub stars have grown steadily since its release (see chart below).
Installation¶
Scrapling requires Python 3.10 or higher:
This installation only includes the parser engine and its dependencies, without any fetchers or commandline dependencies.
Optional Dependencies¶
-
If you are going to use any of the extra features below, the fetchers, or their classes, you will need to install fetchers' dependencies and their browser dependencies as follows:
pip install "scrapling[fetchers]" scrapling install # normal install scrapling install --force # force reinstallThis downloads all browsers, along with their system dependencies and fingerprint manipulation dependencies.
Or you can install them from the code instead of running a command like this:
-
Extra features:
- Install the MCP server feature:
- Install shell features (Web Scraping shell and the
extractcommand): - Install everything:
Don't forget that you need to install the browser dependencies with
scrapling installafter any of these extras (if you didn't already)
Docker¶
You can also install a Docker image with all extras and browsers with the following command from DockerHub:
Or download it from the GitHub registry: This image is automatically built and pushed using GitHub Actions and the repository's main branch.How the documentation is organized¶
Scrapling has extensive documentation, so we try to follow the DiΓ‘taxis documentation framework.
Support¶
If you like Scrapling and want to support its development:
- β Star the GitHub repository
- π Follow us on Twitter and join the discord server
- π Consider sponsoring the project or buying me a coffee
- π Report bugs and suggest features through GitHub Issues
License¶
This project is licensed under the BSD-3 License. See the LICENSE file for details.



