Adaptive Data Scraping Framework (Scrapling Surface)
Trigger (When to Use)
- Batch Data Scraping: When you need to extract structured data (prices, listings, products, articles, etc.) from a batch of pages or an entire website—not operating a single page.
- Target Site Structure Changes: When selectors often break, and you need 'record once, automatically follow the page redesign' with adaptive positioning.
- Ready-Made Crawler Patterns: When you need whole-site crawling (CrawlSpider), sitemap-based (SitemapSpider), Feed/Shopify scraping, and don't want to write loops from scratch.
- Backend API Data: When page data actually comes from XHR/fetch endpoints—use
capture_xhrto receive responses directly, which is faster than parsing the DOM. - Structured Delivery: When results must be exported directly to JSON/JSONL/CSV/XML for downstream pipelines.
When NOT to Use It (Division of Responsibilities)
| Scenario | Use This Skill Instead |
|---|---|
| Single-page operations (clicking, filling forms, screenshots, logged-in actions) | computer-use or browser-playwright skill |
| Fixed, repeatable flow (same click sequence daily) | browser-playwright skill |
| Multi-account matrix, strong anti-bot resistance, Cloudflare paid-level protection | browser-act skill (optional, subject to approval) |
| Scraping public pages, sites that change structure frequently | This skill |
Steps
- Determine Fetching Layer: Use Fetcher for static pages (pure HTTP, fastest); DynamicFetcher for dynamic rendering (Playwright Chromium); StealthyFetcher for fingerprint camouflage where interception is needed. Use the shallowest level possible.
- Remember Key Elements: On first parse, use
auto_save=Trueto save element features. For subsequent calls, passadaptive=True—after page redesign, elements are automatically relocated based on similarity, so you don't have to rework selectors. - Batch Tasks with Spider: Use the declarative pattern with
start_urls+parse; enableAutoThrottle(adjusts speed dynamically based on target site response, backs off on Retry-After); for large tasks, enable checkpoint saving (Ctrl+C to resume). - Capture API Data Directly: When data comes from backend APIs, use
capture_xhrto intercept XHR responses, skipping DOM parsing. - Export to Downstream: Built-in export to JSON/JSONL/CSV/XML, directly feeding into WorkData or file delivery.
- Multi-Session: Use session routing (sid) for different targets or anti-bot levels; rotate proxies via ProxyRotator (client-supplied proxies).
Boundaries (What Not to Do)
- Only Public Data: Target sites must be public pages or the client must have authorization. The list of target domains must pass fence review (
fenceParams.targetDomainsRequireApproval); unapproved targets are not scraped. - Respect robots.txt:
respect_robots_txt=Trueis the default; disabling requires approval and must be logged. - Do Not Force Anti-Bot Measures: StealthyFetcher's fingerprint camouflage is meant for normal scraping to avoid false blocking;
solve_cloudflarelevel anti-bot is off by default; enabling requires approval (same discipline as browser-act). Do not directly confront enterprise-level protection like Akamai/DataDome; switch to manual evaluation. - Rate Limiting is a Mandatory Rule: AutoThrottle is always on; daily request cap per target site is governed by
fenceParams.dailyActionCap, default starting at 500. - Login state is handled by the user themselves; API keys and login state are stored only locally, never included in the skill body or sent out of the system.
- Scraped data must go through the WorkData three-stage waterfall processing (PII sanitization before entering context or leaving the system).
Installation and Dependencies
pip install "scrapling[fetchers]" # Python ≥ 3.10
scrapling install # Download browser dependencies (for DynamicFetcher)
The MCP server form (scrapling[ai]) is an optional enhancement; disabled by default. Enabling it requires approval and must be declared.