progressive http-to-browser fetcher hierarchy with unified response interface
Implements a three-tier fetcher system (Fetcher for static HTTP, dynamic browser fetcher for JavaScript-heavy sites, StealthyFetcher for anti-bot detection) where all tiers return the same Response object inheriting from Selector. This allows developers to start with fast HTTP requests and transparently upgrade to browser automation without changing parsing code. Uses lazy imports via __getattr__ to defer loading heavy dependencies (Playwright, browser engines) until first access, minimizing initial memory footprint and import latency.
Unique: Three-tier progressive fetcher hierarchy with lazy imports and unified Response interface ensures code written for static HTTP works identically with browser automation or stealth fetchers without modification, unlike competitors that require separate code paths or manual strategy switching
vs alternatives: Faster than Scrapy for simple HTTP scraping (no framework overhead) and more flexible than Selenium-only tools because it starts with HTTP and upgrades only when needed, reducing resource consumption by ~70% for static content
adaptive element relocation and dynamic selector resolution
Implements intelligent selector resolution that automatically relocates elements when DOM structure changes between requests, using tree-sitter AST parsing or similar structural analysis to maintain selector validity across page mutations. When a CSS or XPath selector fails, the system analyzes the current DOM and attempts to find the target element using fallback strategies (attribute matching, structural similarity, text content matching). This enables robust scraping of pages with dynamic or inconsistent HTML structures without manual selector maintenance.
Unique: Implements automatic selector relocation using structural DOM analysis and fallback matching strategies, enabling selectors to survive DOM mutations without manual updates—most competitors require static selectors or manual maintenance when HTML changes
vs alternatives: More resilient than Selenium's static selectors because it adapts to DOM changes automatically, and more maintainable than regex-based extraction because it understands HTML structure semantically
custom type handlers and response transformation middleware
Provides extensible middleware system for transforming requests and responses through custom handlers. Developers can register custom type handlers that convert Response objects to domain-specific types (e.g., JSON, CSV, custom dataclasses) or apply transformations (e.g., text cleaning, data validation). Middleware is applied in a pipeline: request → fetcher → response → handlers → output. Handlers can be conditional (applied only to certain URLs or response types) and composable (chained together). The system supports both synchronous and asynchronous handlers for integration with async crawlers.
Unique: Extensible middleware system with conditional, composable, and async-compatible handlers for response transformation and type conversion, integrated into the request-response pipeline—most competitors require manual post-processing or separate transformation steps
vs alternatives: More flexible than Scrapy's item pipelines because handlers are composable and can be applied conditionally, and more integrated than external ETL tools because transformations happen within the scraping pipeline
cli and interactive shell for exploratory scraping
Provides command-line interface (CLI) and interactive REPL shell for testing scrapers without writing code. The CLI supports common operations (fetch URL, parse HTML, extract data) with flags for fetcher selection, proxy configuration, and wait strategies. The interactive shell allows developers to iteratively test selectors, refine extraction logic, and debug issues in real-time. Shell sessions maintain state (current URL, parsed HTML, session cookies) across commands, enabling rapid iteration. Output can be formatted as JSON, CSV, or pretty-printed for easy inspection.
Unique: Integrated CLI and interactive REPL shell with state management (current URL, cookies, parsed HTML) enabling rapid selector testing and debugging without code—most competitors require writing code or using separate browser DevTools
vs alternatives: Faster for prototyping than writing code because selectors can be tested interactively, and more accessible than browser DevTools because it works with Scrapling's full feature set (proxy rotation, stealth, wait strategies)
resource management and performance optimization with lazy loading
Implements lazy loading of heavy dependencies (Playwright, browser engines, proxy libraries) through __getattr__ dynamic imports, reducing initial import time and memory footprint. The system provides resource pooling for browser instances and HTTP connections, automatic cleanup of unused resources, and memory-efficient DOM parsing using streaming where possible. Configuration options allow tuning of pool sizes, timeouts, and resource limits. Monitoring hooks expose resource usage metrics (active connections, browser tabs, memory) for performance analysis and optimization.
Unique: Lazy loading of heavy dependencies combined with resource pooling, automatic cleanup, and built-in monitoring hooks for performance analysis—most competitors load all dependencies upfront or require manual resource management
vs alternatives: More efficient than Scrapy for lightweight use cases because heavy dependencies are lazy-loaded, and more observable than raw Playwright because resource usage is monitored and exposed through hooks
stealth browser automation with anti-detection evasion
Provides StealthyFetcher class that configures Playwright with anti-bot detection evasion techniques including: disabling headless mode indicators, spoofing user agents and device properties, managing WebDriver detection flags, implementing realistic mouse/keyboard behavior patterns, and rotating proxy/IP addresses. The system integrates with proxy rotation middleware to distribute requests across multiple IPs, and configures browser launch parameters to minimize detection signatures. All evasion techniques are composable and can be selectively enabled based on target site requirements.
Unique: Combines multiple evasion techniques (headless mode spoofing, WebDriver detection disabling, realistic behavior patterns, proxy rotation) in a composable architecture where each technique can be independently enabled—most competitors offer either proxy rotation OR browser stealth, not both integrated
vs alternatives: More effective than raw Playwright against modern bot detection because it implements multiple evasion layers simultaneously, and more maintainable than manual Selenium configuration because evasion techniques are pre-configured and composable
unified html parsing with css and xpath selector support
Implements Selector class that wraps BeautifulSoup4/lxml and provides unified API for both CSS and XPath selectors, returning Response objects that themselves inherit from Selector for chainable query syntax. Supports advanced selector features including pseudo-selectors, attribute matching, text content filtering, and relative selectors. The Response object maintains context about the source (HTTP, browser, stealth) and allows seamless chaining of selectors (e.g., response.css('div.item').xpath('.//span[@class="price"]').text()).
Unique: Unified Selector class supporting both CSS and XPath with chainable API where Response objects inherit from Selector, enabling seamless mixing of selector types and nested queries in a single fluent chain—most competitors force choice between CSS or XPath, not both
vs alternatives: More flexible than Scrapy's selectors because it supports both CSS and XPath equally, and more intuitive than raw BeautifulSoup because the chainable API reduces boilerplate and improves readability
session-based connection and browser tab pooling with state management
Provides Session and AsyncSession classes that manage connection pooling for HTTP requests and browser tab pooling for Playwright-based fetchers. HTTP sessions reuse TCP connections to reduce latency and overhead. Browser sessions maintain a pool of tabs (configurable size) that are recycled across requests, avoiding the overhead of launching new browser instances. Sessions also manage cookies, headers, and authentication state across multiple requests, with optional persistence to disk. The architecture supports concurrent request handling through async/await patterns.
Unique: Implements browser tab pooling (recycling tabs across requests) combined with HTTP connection pooling and unified session state management, reducing resource overhead by ~60% compared to launching new browser instances per request—most competitors either pool connections OR manage browser instances, not both
vs alternatives: More efficient than Selenium because it reuses browser tabs instead of launching new instances, and more scalable than raw Playwright because session pooling abstracts away manual resource management
+5 more capabilities