
Scrapling
- 212 installs
- 40 repo stars
- Updated August 4, 2026
- akillness/oh-my-skills
Build resilient web scraping pipelines with Scrapling to ingest external pages, normalize extracted data, and feed agents, APIs, or ETL jobs without brittle one-off scripts.
About
Teaches Scrapling-based scraping workflows: selector design, session handling, pagination, deduplication, and structured exports so teams integrate external web data into agents, APIs, and automation pipelines reliably at build time.
- Resilient page fetching patterns
- DOM parsing and extraction rules
- Anti-bot and retry strategies
- Normalized output schemas
- Agent and ETL feed hooks
Scrapling by the numbers
- 212 all-time installs (skills.sh)
- Ranked #580 of 2,715 Automation & Workflows skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/akillness/oh-my-skills --skill scraplingAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 212 |
|---|---|
| repo stars | ★ 40 |
| Last updated | August 4, 2026 |
| Repository | akillness/oh-my-skills ↗ |
What it does
Build resilient web scraping pipelines with Scrapling to ingest external pages, normalize extracted data, and feed agents, APIs, or ETL jobs without brittle one-off scripts.
Files
scrapling - routing-first adaptive web scraping
Keyword:scrapling·adaptive scraping·stealthy fetch·scrapling spider
>
Respect each target site's terms, robots, rate limits, authorization boundaries, and anti-abuse policies.
Scrapling is most useful when you choose the smallest scraping mode that fits the job:
- parse known HTML before reaching for a browser
- start with plain HTTP before rendering JavaScript
- escalate to stealth only when simpler paths fail
- switch to spiders only when crawl state and multi-page orchestration become the real problem
When to use this skill
- The user needs one page or a few pages extracted and you must decide between parser-only, HTTP fetch, browser rendering, or stealth
- The user wants to prototype with
scrapling extract,scrapling shell, or wrapper scripts instead of writing Python first - The user wants adaptive selector recovery because the target DOM changes over time
- The user wants Scrapling exposed to an agent via MCP
- The user is about to turn repeated fetches into a site crawl and needs to know when Scrapling spiders are justified
- The user keeps drifting toward Playwright/Crawlee-style orchestration, direct API interception, or managed unblockers and needs an honest route-out
Instructions
Step 1: Capture one intake packet before choosing tools
Collect the minimum packet:
- Target class: raw HTML, normal web page, JS-rendered app, protected site, or many-page crawl
- Desired output: CSS/XPath extraction, Markdown/text file, structured records, or long-running crawl output
- Operational need: quick probe, repeated session reuse, agent/MCP access, or resumable crawling
- Constraint: install budget, browser availability, auth/proxy limits, and whether direct API/JSON access may be better than DOM scraping
Use this rule set:
1. If HTML is already available, start with Selector 2. If a live page is needed, start with Fetcher 3. If the content is rendered client-side, move to DynamicFetcher 4. If the rendered path is still blocked or empty, move to StealthyFetcher 5. If the job is now queueing, link following, retries, or checkpoints, move to spiders 6. If the real need is browser automation, pre-navigation request interception, or a managed unblocker, route out instead of over-promising Scrapling
Detailed packet examples and route-outs live in references/intake-packets-and-route-outs.md.
Step 2: Install only the profile you need
Use a virtual environment unless the user explicitly wants a system install.
bash scripts/install.sh --profile parser
bash scripts/install.sh --profile fetchers
bash scripts/install.sh --profile shell
bash scripts/install.sh --profile ai
bash scripts/install.sh --profile allInstallation guidance:
parser— local HTML parsing onlyfetchers— HTTP + browser-backed fetchersshell— interactive CLI shell workflowsai— MCP server workflowsall— only when the user truly needs the full surface
Browser-backed flows require scrapling install. Parser-only workflows do not.
Step 3: Choose the lightest extraction path that fits
A. Parser-only path
Use this when HTML is already available or the user mainly needs selector logic.
from scrapling import Selector
page = Selector(html_doc, url="https://example.com")
items = page.css("article h2::text").getall()Use this path for:
- local HTML fixtures
- saved responses
- quick selector authoring
- low-cost extraction without network/browser concerns
B. HTTP fetch path
Use Fetcher or FetcherSession when plain HTTP is likely enough.
from scrapling.fetchers import Fetcher
page = Fetcher.get("https://example.com", impersonate="chrome")
title = page.css("title::text").get()Prefer this path for:
- docs, blogs, many marketing pages, search results, simple product pages
- cheap repeated requests with session reuse
- cases where the user only needs rendered HTML if evidence proves HTTP is insufficient
C. Dynamic browser path
Use DynamicFetcher or DynamicSession when the target is JS-rendered.
from scrapling.fetchers import DynamicFetcher
page = DynamicFetcher.fetch(
"https://example.com/app",
network_idle=True,
wait_selector=".content"
)Reach for this when:
- the page is a SPA/dashboard
- content appears only after client-side rendering
- small interaction or wait controls are enough
D. Stealth path
Use StealthyFetcher or StealthySession only when the lighter paths fail because of protection.
from scrapling.fetchers import StealthyFetcher
page = StealthyFetcher.fetch(
"https://example.com/protected",
headless=True,
solve_cloudflare=True
)Important:
- Treat anti-bot handling as a documented capability, not a guarantee
- If a target still fails or requires stronger infra, route honestly to proxies or managed unblockers instead of pretending one more flag will always fix it
Fetcher/session details live in references/fetchers-and-sessions.md.
Step 4: Use adaptive scraping only when selector drift is the problem
Adaptive scraping is valuable when the DOM changes but the semantic target is still the same.
from scrapling.fetchers import Fetcher
Fetcher.configure(adaptive=True)
page = Fetcher.get("https://example.com")
saved = page.css(".product", auto_save=True)
relocated = page.css(".product", adaptive=True)Remember:
adaptive=Trueis opt-inauto_save=Truestores fingerprints for later reuse- manual
save(),retrieve(), andrelocate()flows are available - this helps brittle selectors, not auth failures or full site redesign strategy
Parser/adaptive details live in references/parser-and-adaptive.md.
Step 5: Choose the right operator surface
CLI / shell
Use CLI when the user wants quick output files or a terminal-first probe.
bash scripts/run-extract.sh get "https://example.com" article.md --css-selector "article"
bash scripts/run-extract.sh fetch "https://app.example.com" content.md --network-idle
bash scripts/run-extract.sh stealth "https://protected.example.com" content.md --solve-cloudflareUse scrapling shell when the user wants an interactive REPL rather than a standalone script.
MCP
Use MCP when the goal is agent-facing access instead of a bespoke scraper script.
bash scripts/run-mcp.sh
bash scripts/run-mcp.sh --http --host 127.0.0.1 --port 8000Start with stdio for local agent integration; use HTTP only when the environment already expects streamable HTTP.
CLI/MCP details live in references/cli-and-mcp.md.
Step 6: Switch to spiders only when crawl state matters
Use spiders when the task needs:
- multiple pages and link following
- retries and blocked-response handling
- concurrency and session routing
- pause/resume checkpoints via
crawldir
For one or two isolated pages, fetchers remain simpler.
from scrapling.spiders import Spider, Response
class QuotesSpider(Spider):
name = "quotes"
start_urls = ["https://quotes.toscrape.com/"]
async def parse(self, response: Response):
for quote in response.css(".quote"):
yield {"text": quote.css(".text::text").get()}Spider details live in references/spiders.md.
Examples
Example 1: I already have HTML and just need selectors
Use Selector, not a browser.
Example 2: A marketing page loads over plain HTTP
Start with Fetcher or scrapling extract get, then escalate only if evidence says the content is missing.
Example 3: A React dashboard is empty until JS runs
Move to DynamicFetcher and use network_idle or wait_selector.
Example 4: A protected target returns a challenge page
Try StealthyFetcher, but make it explicit that stronger proxy/unblocker infrastructure may still be required.
Example 5: An agent needs bounded web extraction
Expose Scrapling through MCP instead of forcing a handwritten scraper first.
Example 6: The task has become a real crawl
Route from repeated fetches into spiders with checkpointing and session control.
Best practices
1. Start with the smallest viable mode and escalate only on evidence. 2. Prefer direct API/JSON access when that is the real source of truth; do not force DOM scraping for browser-heavy apps. 3. Reuse sessions for repeated requests instead of relaunching browsers on every page. 4. Use adaptive scraping for selector drift, not as a blanket fix for every failure mode. 5. Prefer CSS selectors plus .md or .txt outputs to keep model context smaller. 6. Treat CLI, MCP, and spiders as operator surfaces layered on top of the same routing logic, not three unrelated features. 7. Route honestly to Playwright/Crawlee-style automation, external unblockers, or another extraction service when Scrapling is no longer the best fit.
References
- references/intake-packets-and-route-outs.md
- references/fetchers-and-sessions.md
- references/parser-and-adaptive.md
- references/cli-and-mcp.md
- references/spiders.md
- scripts/install.sh
- scripts/run-extract.sh
- scripts/run-mcp.sh
- Scrapling GitHub Repository
- Scrapling Documentation
{
"skill_name": "scrapling",
"evals": [
{
"id": 1,
"prompt": "Scrapling으로 정적 사이트에서 글 목록만 빨리 긁고 싶은데 어떤 방식으로 시작해야 해?",
"expected_output": "The skill starts with parser-only or plain HTTP, not browser or stealth by default.",
"assertions": [
"The response recommends `Selector`, `Fetcher`, or `scrapling extract get` first",
"The response treats static scraping as the lightest path"
]
},
{
"id": 2,
"prompt": "SPA 대시보드라 JS 렌더링이 필요해. Scrapling에서 뭐를 써야 해?",
"expected_output": "The skill switches to DynamicFetcher or CLI fetch and mentions browser waiting controls.",
"assertions": [
"The response recommends `DynamicFetcher`, `DynamicSession`, or `scrapling extract fetch`",
"The response mentions controls such as `network_idle` or `wait_selector`"
]
},
{
"id": 3,
"prompt": "Cloudflare Turnstile이 있는 사이트를 Scrapling으로 처리하고 싶어.",
"expected_output": "The skill escalates to stealth mode but keeps the success claim honest.",
"assertions": [
"The response recommends `StealthyFetcher`, `StealthySession`, or `stealthy-fetch`",
"The response mentions `solve_cloudflare` or equivalent stealth controls",
"The response does not promise guaranteed bypass success"
]
},
{
"id": 4,
"prompt": "사이트 구조가 바뀌어도 같은 요소를 계속 찾고 싶어. Scrapling adaptive 기능 어떻게 써?",
"expected_output": "The skill explains adaptive scraping with save and recovery behavior.",
"assertions": [
"The response mentions `adaptive=True`",
"The response mentions `auto_save=True` or `save`/`retrieve`/`relocate`"
]
},
{
"id": 5,
"prompt": "에이전트가 Scrapling 도구를 MCP로 쓰게 만들고 싶어.",
"expected_output": "The skill explains the MCP server command and the basic tool surface.",
"assertions": [
"The response includes `scrapling mcp` or the wrapper script",
"The response mentions MCP tools such as `get`, `fetch`, or `stealthy_fetch`"
]
},
{
"id": 6,
"prompt": "단건 스크래핑이 아니라 사이트 전체를 따라가며 수집해야 해.",
"expected_output": "The skill moves from fetchers to spiders and mentions crawl controls.",
"assertions": [
"The response recommends Scrapling spiders",
"The response mentions concurrency, follow-up requests, or `crawldir` checkpointing"
]
},
{
"id": 7,
"prompt": "브라우저에서 보는 대시보드보다 내부 JSON API가 진짜 데이터야. Scrapling으로 어떻게 접근하는 게 좋아?",
"expected_output": "The skill routes toward the real source of truth instead of forcing DOM scraping.",
"assertions": [
"The response says direct API or request interception may be better than DOM scraping",
"The response does not force `DynamicFetcher` as the only answer"
]
},
{
"id": 8,
"prompt": "StealthyFetcher도 계속 막히는데 그냥 옵션 더 넣으면 되나?",
"expected_output": "The skill gives an honest route-out to managed unblockers or another stack when Scrapling is no longer enough.",
"assertions": [
"The response says stealth is not guaranteed",
"The response suggests escalating to proxies, managed unblockers, or another stack if needed"
]
}
]
}
CLI and MCP
Scrapling's CLI covers install, shell, extraction, and MCP server startup.
Install and shell
pip install "scrapling[shell]"
scrapling install
scrapling shell
scrapling shell -c 'Fetcher.get("https://example.com").css("title::text").get()'scrapling shell is useful when the user wants an interactive REPL backed by IPython instead of a standalone script.
Extract commands
The extract group supports:
getpostputdeletefetchstealthy-fetch
Output format follows the target file extension:
.mdfor Markdown conversion.htmlfor raw HTML.txtfor cleaner text content
Examples:
scrapling extract get "https://example.com" article.md
scrapling extract post "https://api.example.com/search" result.html --json '{"query":"shoes"}'
scrapling extract fetch "https://app.example.com" dashboard.md --network-idle
scrapling extract stealthy-fetch "https://protected.example.com" data.txt --solve-cloudflareUseful shared flags:
-s, --css-selector--proxy--timeout-H, --headersor--extra-headers
Useful browser flags:
--headlessor--no-headless--network-idle--wait--wait-selector--real-chrome
Stealth-only flags:
--solve-cloudflare--block-webrtc--allow-webglor--block-webgl--hide-canvas
Wrapper script
This skill includes:
bash scripts/run-extract.sh <mode> <url> <output_file> [extra args...]Mode aliases:
getpostputdeletefetchstealthy-fetchdynamic->fetchstealth->stealthy-fetchauto->get
MCP server
Scrapling's MCP server exposes six main tools:
getbulk_getfetchbulk_fetchstealthy_fetchbulk_stealthy_fetch
Local stdio mode:
pip install "scrapling[ai]"
scrapling install
scrapling mcpStreamable HTTP mode:
scrapling mcp --http --host 0.0.0.0 --port 8000Wrapper:
bash scripts/run-mcp.sh --http --host 127.0.0.1 --port 8000Minimal Claude-style config:
{
"mcpServers": {
"ScraplingServer": {
"command": "scrapling",
"args": ["mcp"]
}
}
}Operational guidance
- Start with stdio MCP for local agent use
- Use HTTP transport only when the environment already expects streamable HTTP
- Prefer CSS selectors in extraction commands to avoid returning giant documents
- Use
.mdoutput for model-friendly inspection unless raw HTML is necessary
Fetchers and Sessions
Scrapling has three main fetching tiers. Treat them as an escalation ladder, not interchangeable defaults.
1. Fetcher
Use Fetcher or FetcherSession when plain HTTP is enough.
- Engine:
curl_cffi - Strengths: speed, low memory, browser fingerprint impersonation, stealthy headers, HTTP/3 support
- Best for: blogs, docs, APIs, mostly static HTML, lightweight paginated sites
Example:
from scrapling.fetchers import FetcherSession
with FetcherSession(impersonate="chrome") as session:
page = session.get("https://quotes.toscrape.com/", stealthy_headers=True)
quotes = page.css(".quote .text::text").getall()Useful knobs:
impersonatestealthy_headersproxytimeoutselector_config
2. DynamicFetcher
Use DynamicFetcher or DynamicSession when a browser is required but the target is not especially hostile.
- Engine: Playwright-backed Chromium or local Chrome
- Strengths: JavaScript rendering, waiting controls,
page_action, real browser option - Best for: SPAs, dashboards, lazy-loaded lists, small automation steps
Common options:
headlessdisable_resourcesnetwork_idlewaitwait_selectorreal_chromepage_actionproxy
page_action assumes some familiarity with Playwright's page API. Do not present it as a no-knowledge shortcut.
Example:
from scrapling.fetchers import DynamicSession
with DynamicSession(headless=True, network_idle=True) as session:
page = session.fetch("https://example.com/app")
data = page.css(".row .name::text").getall()3. StealthyFetcher
Use StealthyFetcher or StealthySession when anti-bot systems interfere with normal rendering.
- Engine: patchright-backed browser stack
- Strengths: harder fingerprint evasion, Cloudflare Turnstile or interstitial solving, browser hardening toggles
- Best for: protected commerce, travel, ticketing, and sites that return blocks or empty states to simpler fetchers
Common options beyond DynamicFetcher:
solve_cloudflareblock_webrtcallow_webglhide_canvasmax_pages
Treat anti-bot handling as a documented capability, not a guarantee.
Example:
from scrapling.fetchers import StealthySession
with StealthySession(headless=True, solve_cloudflare=True) as session:
page = session.fetch("https://nopecha.com/demo/cloudflare")
links = page.css("#padded_content a::attr(href)").getall()Session guidance
Prefer session classes when:
- You need repeated requests with the same config
- You want connection, cookie, or browser reuse
- You want a rotating pool of browser tabs
- You are building a spider or multi-step workflow
Use one-off class methods only for short probes or tiny scripts.
Quick decision rule
1. Start with Fetcher 2. If the page needs JavaScript, move to DynamicFetcher 3. If the rendered result is still blocked, move to StealthyFetcher
Do not jump straight to stealth unless there is evidence that simpler paths fail.
Intake Packets and Route-outs
Use this note when the front door needs to stay small.
1. Intake packet
Ask for the smallest packet that decides the mode:
| Field | What to capture | Why it matters |
|---|---|---|
| Target class | raw HTML, normal page, JS app, protected site, or crawl | Decides parser vs fetcher vs stealth vs spider |
| Desired output | selector result, Markdown/text file, structured records, or crawl dataset | Decides CLI vs Python vs spider export surface |
| Scope | one page, a few pages, or many-page traversal | Prevents over-jumping into spiders |
| Constraints | browser availability, proxy budget, auth, rate limits, agent integration | Keeps install and route choices honest |
| Source of truth | DOM, direct API/JSON, downloadable document, or site search | Prevents unnecessary browser scraping |
2. Quick routing table
| Situation | Default move | Why |
|---|---|---|
| HTML already exists | Selector | Cheapest selector path |
| Plain server-rendered page | Fetcher / FetcherSession | Avoid browser overhead |
| Client-rendered page | DynamicFetcher / DynamicSession | Browser rendering is justified |
| Protected target returns blocks/challenge/empty state | StealthyFetcher / StealthySession | Escalate only after lighter paths fail |
| Repeated page traversal / queueing / checkpoints | Spiders | Crawl state matters now |
| Agent needs a bounded web tool | MCP | Expose a tool surface instead of bespoke code |
3. Honest route-outs
Route out instead of stretching Scrapling when the user actually needs:
- Direct API interception or request hooks before navigation → consider Playwright/Crawlee-style browser automation or direct HTTP requests if the real data source is JSON/API, not the rendered DOM.
- Reliable managed anti-bot infrastructure → consider external proxy/unblocker providers rather than implying
StealthyFetcherwill always succeed. - Large-scale distributed crawling and queue orchestration → consider a crawler framework or existing crawl stack if Scrapling spiders are no longer the smallest practical abstraction.
- Fast LLM-ready page ingestion without custom extraction logic → consider an agent-facing extraction service when deterministic custom scraping is not required.
4. Failure-language guidance
Say this explicitly when needed:
- "Start with the lightest mode that proves the data is reachable."
- "Stealth is a later escalation, not the default."
- "Adaptive scraping helps with selector drift, not auth or anti-bot guarantees."
- "If the real source of truth is an API response, route to direct request interception instead of forcing DOM scraping."
- "If the site still fails after honest stealth attempts, escalate to a managed unblocker or different stack rather than promising more flags will fix it."
Parser and Adaptive Scraping
Every fetcher returns a Response object, and Response inherits Scrapling's Selector parsing engine.
Selection primitives
Supported selection patterns:
- CSS selectors:
page.css(".product") - XPath selectors:
page.xpath("//article") - Text nodes:
page.css("h1::text").get() - Attribute values:
page.css("a::attr(href)").getall() - Text search:
find_by_text(...) - Regex search:
find_by_regex(...) - Similar elements:
element.find_similar(...)
Scrapling's docs are centered on HTML parsing. XML feeds are not the current target surface.
Useful reminders:
css()andxpath()return selector collections.get()and.getall()are the most convenient for text or attribute extractionfind_similar()is useful after locating one representative item by text or regex
Adaptive scraping
Adaptive scraping lets Scrapling relocate changed elements without using an LLM.
Two phases:
1. Save an element fingerprint 2. Match a future element with similar properties
CSS or XPath flow
from scrapling.fetchers import Fetcher
Fetcher.configure(adaptive=True)
page = Fetcher.get("https://example.com")
original = page.css("#primary-cta", auto_save=True)
recovered = page.css("#primary-cta", adaptive=True)Key points:
adaptive=Truemust be enabled globally or in selector configauto_save=Truestores the current matched element- later,
adaptive=Truetells Scrapling to relocate the element if the original selector stops matching
Manual save and relocate flow
Use this when the original element was found by text, regex, or another indirect method.
element = page.find_by_text("Tipping the Velvet", first_match=True)
page.save(element, "featured-book")
saved = page.retrieve("featured-book")
matches = page.relocate(saved, selector_type=True)adaptive_domain
Use adaptive_domain when equivalent pages live on different domains or archival hosts and should share the same adaptive fingerprint store.
This is especially useful for:
- archived vs live versions of the same site
- domain migrations
- CDN or locale host changes
Adaptive scraping is not automatic magic:
- you must enable
adaptive=True - you must save an element first through
auto_save=Trueor manualsave() - relocation quality still depends on the surviving similarity of the target element
Similar-element discovery
find_similar() is useful when you have one known good element and need its peers.
Typical pattern:
1. find a product link by text 2. call .find_similar() on that element 3. iterate the sibling product cards
This is often easier than writing brittle container selectors from scratch.
Practical recommendations
- Use CSS first; drop to XPath when CSS becomes awkward
- Save adaptive fingerprints only for selectors that repeatedly break
- Keep identifiers meaningful when using manual adaptive storage
- Prefer text or attribute extraction over raw HTML blobs unless structure inspection is required
Spiders
Scrapling spiders are a Scrapy-inspired async crawling framework built on top of Scrapling's fetchers and parser.
When to switch from fetchers to spiders
Use a spider when the job needs:
- multiple pages and link following
- concurrent request scheduling
- retry and blocked-response handling
- checkpoint pause or resume
- different session types in one crawl
For one or two isolated pages, plain fetchers are simpler.
Minimal spider
from scrapling.spiders import Spider, Response
class QuotesSpider(Spider):
name = "quotes"
start_urls = ["https://quotes.toscrape.com/"]
concurrent_requests = 10
async def parse(self, response: Response):
for quote in response.css(".quote"):
yield {
"text": quote.css(".text::text").get(),
"author": quote.css(".author::text").get(),
}
next_page = response.css(".next a::attr(href)").get()
if next_page:
yield response.follow(next_page)
result = QuotesSpider().start()
result.items.to_json("quotes.json")Mental model
The spider system is composed of:
Spider: your crawl definitionScheduler: queued request storage with deduplicationCrawler Engine: concurrency and callback orchestrationSession Manager: routes requests to the correct fetcher session- checkpoint storage: saves pending requests and seen fingerprints to disk
Sessions inside spiders
Spiders can use multiple named sessions, including:
FetcherSessionAsyncDynamicSessionAsyncStealthySession
Requests choose the session by sid, which lets the same spider mix cheap HTTP paths with heavier browser paths only where needed.
Pause and resume
Use crawldir when the crawl must resume after interruption.
- Pending requests and seen fingerprints are checkpointed
- Graceful shutdown writes a final checkpoint
- Restarting with the same
crawldirresumes instead of rebuildingstart_requests()
This is the Scrapling equivalent of job-directory style crawling.
Hooks and control points
Useful spider customization areas include:
start_requests()parse()and additional callbacks- blocked-response detection or retry logic
- item export through
result.items.to_json()or.to_jsonl() - streaming flows via
async for item in spider.stream()
Practical recommendations
- Keep concurrency modest until the target site proves stable
- Route only the hard pages through stealth sessions
- Use
allowed_domainsand explicit follow logic to keep scope clean - Turn on checkpointing for long-running crawls or unstable networks
#!/usr/bin/env bash
set -euo pipefail
PYTHON_BIN="${PYTHON_BIN:-python3}"
PROFILE="${PROFILE:-all}"
SCRAPLING_SPEC=""
FORCE_FLAG=""
while (($# > 0)); do
case "$1" in
--profile)
PROFILE="$2"
shift 2
;;
--force)
FORCE_FLAG="--force"
shift
;;
*)
echo "Unknown argument: $1" >&2
echo "Usage: bash scripts/install.sh [--profile parser|fetchers|shell|ai|all] [--force]" >&2
exit 2
;;
esac
done
if ! command -v "$PYTHON_BIN" >/dev/null 2>&1; then
echo "Python interpreter not found: $PYTHON_BIN" >&2
exit 1
fi
case "$PROFILE" in
parser)
SCRAPLING_SPEC="scrapling>=0.4.2"
;;
fetchers)
SCRAPLING_SPEC='scrapling[fetchers]>=0.4.2'
;;
shell)
SCRAPLING_SPEC='scrapling[shell]>=0.4.2'
;;
ai)
SCRAPLING_SPEC='scrapling[ai]>=0.4.2'
;;
all)
SCRAPLING_SPEC='scrapling[all]>=0.4.2'
;;
*)
echo "Unsupported profile: $PROFILE" >&2
exit 2
;;
esac
"$PYTHON_BIN" -m pip install "$SCRAPLING_SPEC"
"$PYTHON_BIN" -c 'import scrapling; print(f"scrapling {scrapling.__version__}")'
if [[ "$PROFILE" != "parser" ]]; then
"$PYTHON_BIN" -m scrapling.cli install ${FORCE_FLAG:+$FORCE_FLAG}
fi
#!/usr/bin/env bash
set -euo pipefail
if (($# < 3)); then
echo "Usage: bash scripts/run-extract.sh <mode> <url> <output_file> [extra scrapling args...]" >&2
echo "Modes: get, post, put, delete, fetch, stealthy-fetch, dynamic, stealth, auto" >&2
exit 2
fi
SCRAPLING_BIN="${SCRAPLING_BIN:-scrapling}"
MODE="$1"
URL="$2"
OUTPUT_FILE="$3"
shift 3
case "$MODE" in
auto|get)
COMMAND=(extract get)
;;
post|put|delete|fetch|stealthy-fetch)
COMMAND=(extract "$MODE")
;;
dynamic)
COMMAND=(extract fetch)
;;
stealth|protected)
COMMAND=(extract stealthy-fetch)
;;
*)
echo "Unsupported mode: $MODE" >&2
exit 2
;;
esac
exec "$SCRAPLING_BIN" "${COMMAND[@]}" "$URL" "$OUTPUT_FILE" "$@"
#!/usr/bin/env bash
set -euo pipefail
SCRAPLING_BIN="${SCRAPLING_BIN:-scrapling}"
HTTP_FLAG=""
HOST="0.0.0.0"
PORT="8000"
while (($# > 0)); do
case "$1" in
--http)
HTTP_FLAG="--http"
shift
;;
--host)
HOST="$2"
shift 2
;;
--port)
PORT="$2"
shift 2
;;
*)
echo "Unknown argument: $1" >&2
echo "Usage: bash scripts/run-mcp.sh [--http] [--host HOST] [--port PORT]" >&2
exit 2
;;
esac
done
if [[ -n "$HTTP_FLAG" ]]; then
exec "$SCRAPLING_BIN" mcp --http --host "$HOST" --port "$PORT"
fi
exec "$SCRAPLING_BIN" mcp
Experiment 0 - baseline
Score: 4/6 Change: Initial draft only. Reasoning: Establish the baseline before mutating the skill. Result: Covered the high-level surface area but was too light on adaptive relocation and CLI operational specifics. Remaining failures: Adaptive details and concrete CLI guidance were not explicit enough.
Experiment 1 - keep
Score: 6/6 Change: Added the fetcher escalation ladder, adaptive examples, wrapper scripts, MCP tool framing, and clearer spider-switch guidance. Reasoning: The baseline risk was that the skill named features without making them operationally selectable. Result: All six binary evals passed. Remaining failures: None in the current eval suite.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>scrapling skill autoresearch</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
:root {
--bg: #f5efe4;
--panel: #fffaf2;
--ink: #1c1a17;
--muted: #6e675d;
--line: #d7c9b2;
--keep: #0f766e;
--base: #8a5a12;
}
body {
margin: 0;
padding: 32px;
font-family: "Iowan Old Style", "Palatino Linotype", serif;
background:
radial-gradient(circle at top left, rgba(184, 142, 72, 0.18), transparent 28%),
linear-gradient(180deg, #f7f1e8, var(--bg));
color: var(--ink);
}
.wrap {
max-width: 980px;
margin: 0 auto;
}
h1, h2 {
margin: 0 0 12px;
}
p {
color: var(--muted);
line-height: 1.5;
}
.grid {
display: grid;
gap: 16px;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
margin: 24px 0;
}
.card {
background: var(--panel);
border: 1px solid var(--line);
border-radius: 18px;
padding: 18px;
box-shadow: 0 12px 24px rgba(47, 36, 18, 0.06);
}
table {
width: 100%;
border-collapse: collapse;
background: var(--panel);
border: 1px solid var(--line);
border-radius: 18px;
overflow: hidden;
}
th, td {
padding: 12px 14px;
border-bottom: 1px solid var(--line);
text-align: left;
vertical-align: top;
font-size: 14px;
}
th {
background: #f1e5d2;
}
.status-keep { color: var(--keep); font-weight: 700; }
.status-baseline { color: var(--base); font-weight: 700; }
code {
background: #f0e7da;
padding: 2px 6px;
border-radius: 6px;
}
</style>
</head>
<body>
<div class="wrap">
<h1>scrapling skill autoresearch</h1>
<p>Baseline versus improved prompt behavior for the local <code>scrapling</code> skill. Open alongside <code>results.json</code> for the latest experiment log.</p>
<div class="grid">
<div class="card">
<h2>Baseline</h2>
<p>Experiment 0 scored 4/6. High-level coverage was present, but adaptive recovery and CLI operational detail were too weak.</p>
</div>
<div class="card">
<h2>Final</h2>
<p>Experiment 1 scored 6/6 after adding a fetcher escalation ladder, adaptive examples, MCP framing, and clearer spider guidance.</p>
</div>
<div class="card">
<h2>Focus</h2>
<p>Binary evals concentrated on fetcher choice, adaptive scraping, CLI and MCP usability, spider handoff, and reference hygiene.</p>
</div>
</div>
<table>
<thead>
<tr>
<th>Experiment</th>
<th>Status</th>
<th>Score</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td class="status-baseline">baseline</td>
<td>4 / 6</td>
<td>Initial draft established scope but left adaptive recovery and CLI selection underspecified.</td>
</tr>
<tr>
<td>1</td>
<td class="status-keep">keep</td>
<td>6 / 6</td>
<td>Kept mutation added operational fetcher selection, adaptive examples, wrapper scripts, and spider-switch criteria.</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
{
"skill_name": "scrapling",
"status": "complete",
"updated_at": "2026-03-28T05:45:00Z",
"evals": [
{
"id": "fetcher-escalation",
"question": "Does the skill start with Fetcher and escalate to DynamicFetcher or StealthyFetcher only when needed?"
},
{
"id": "adaptive-detail",
"question": "Does the skill explicitly explain adaptive scraping with `adaptive=True` and either `auto_save=True` or manual save and relocate methods?"
},
{
"id": "cli-coverage",
"question": "Does the skill cover CLI extract, shell, and practical output handling for `.md`, `.html`, or `.txt`?"
},
{
"id": "mcp-coverage",
"question": "Does the skill explain `scrapling mcp` and the MCP tool surface well enough for agent integration?"
},
{
"id": "spider-guidance",
"question": "Does the skill tell the user when to switch from fetchers to spiders and mention concurrency or checkpointing?"
},
{
"id": "reference-support",
"question": "Does the skill point to scripts and focused reference files instead of overloading the main SKILL.md?"
}
],
"experiments": [
{
"experiment": 0,
"score": 4,
"max_score": 6,
"pass_rate": 0.6667,
"status": "baseline",
"description": "Initial draft described the broad Scrapling surface but lacked concrete adaptive recovery instructions and operational detail for CLI and escalation decisions.",
"kept": true,
"per_eval": {
"fetcher-escalation": true,
"adaptive-detail": false,
"cli-coverage": false,
"mcp-coverage": true,
"spider-guidance": true,
"reference-support": true
}
},
{
"experiment": 1,
"score": 6,
"max_score": 6,
"pass_rate": 1.0,
"status": "keep",
"description": "Kept mutation: added fetcher escalation rules, explicit adaptive examples, wrapper scripts, CLI output guidance, and sharper criteria for switching to spiders.",
"kept": true,
"per_eval": {
"fetcher-escalation": true,
"adaptive-detail": true,
"cli-coverage": true,
"mcp-coverage": true,
"spider-guidance": true,
"reference-support": true
}
}
]
}
experiment score max_score pass_rate status description
0 4 6 0.6667 baseline Initial draft covered install, fetcher choice, CLI, MCP, and spiders but under-specified adaptive recovery details and did not give enough concrete operational guidance for CLI and stealth escalation.
1 6 6 1.0000 keep Added an escalation ladder, explicit adaptive instructions, MCP tool framing, wrapper scripts, and clearer crawler guidance.
---
name: scrapling
description: >
Install and use Scrapling for web scraping through Python code, CLI commands,
stealth fetching, adaptive scraping, and spiders.
allowed-tools: Bash Read Write Edit Glob Grep WebFetch
compatibility: Requires Python 3.10+ and browser dependencies for dynamic flows.
license: BSD-3-Clause
metadata:
version: "baseline"
---
# scrapling - Baseline Draft
Use Scrapling when the user needs to scrape websites, crawl pages, use dynamic browsers, bypass some protections, or expose scraping tools through MCP.
## When to use this skill
- Install Scrapling
- Choose fetchers
- Use CLI extract commands
- Use MCP
- Write spiders
## Instructions
### Step 1: Install
Install Scrapling with all extras and run `scrapling install`.
### Step 2: Choose a fetcher
- `Fetcher` for simple HTTP
- `DynamicFetcher` for JavaScript
- `StealthyFetcher` for protections
### Step 3: Parse the result
Use CSS, XPath, text selection, and adaptive features.
### Step 4: Operate the CLI
Use `scrapling extract` or `scrapling shell`.
### Step 5: Use MCP or spiders when needed
Use `scrapling mcp` for agent tools and spiders for larger crawls.
N:scrapling
D:[scrapling] Route web-scraping work into the lightest workable Scrapling mode instead of defaulting to a browser. Use when the user needs HTML extraction, JS-rendered page retrieval, protected-target escalation, quick CLI scraping, agent-facing MCP access, or a larger crawl with Scrapling spiders.
G:scrapling web-scraping crawling adaptive-scraping mcp cli playwright cloudflare spiders python selector-drift
U[8]:
Capture one intake packet: target class, output, scope, and constraints before choosing tools
Start with Selector or Fetcher and escalate to DynamicFetcher or StealthyFetcher only on evidence
Use adaptive scraping for selector drift, not as a blanket fix for auth or anti-bot failures
Prefer direct API or request interception when the DOM is not the real source of truth
Use CLI and shell for quick probes and bounded extraction output
Use MCP when the goal is agent-facing web tools rather than custom scraper code
Switch to spiders only when crawl state, queues, retries, or checkpoints are the real problem
Route honestly to managed unblockers or other stacks when Scrapling is no longer the best fit
S[6]{n,action,details}:
1,Intake,capture target class output scope constraints and source-of-truth before choosing a mode
2,Install,bash scripts/install.sh --profile parser|fetchers|shell|ai|all and run scrapling install only for browser-backed paths
3,Choose extraction,use Selector or Fetcher first then escalate to DynamicFetcher or StealthyFetcher only when evidence requires it
4,Handle drift,use adaptive=True and auto_save or retrieve or relocate only for brittle selectors
5,Choose surface,use bash scripts/run-extract.sh or bash scripts/run-mcp.sh when CLI or agent access is better than bespoke code
6,Scale or route out,move to spiders for crawl state and route to direct API interception browser automation or managed unblockers when Scrapling is the wrong layer
R[8]:
The lightest workable mode beats browser-first scraping most of the time
Adaptive scraping helps with selector drift not auth or protection guarantees
Session reuse is better than repeated one-off browser launches for multi-page work
CSS selectors plus md or txt outputs reduce token and storage overhead
MCP is the simplest local agent integration when the user wants tool exposure not scraper design
Spiders are justified when queueing traversal retries and checkpoints become the job
Stealth is a later escalation not a guaranteed bypass
If the real data is an API response route there instead of forcing DOM scraping
E[6]{type,command}:
Parser,python -c 'from scrapling import Selector; page=Selector("<html></html>", url="https://example.com")'
Static CLI,bash scripts/run-extract.sh get "https://example.com" content.md --css-selector "article"
Dynamic CLI,bash scripts/run-extract.sh fetch "https://app.example.com" content.md --network-idle
Stealth CLI,bash scripts/run-extract.sh stealth "https://protected.example.com" content.md --solve-cloudflare
MCP,bash scripts/run-mcp.sh --http --host 127.0.0.1 --port 8000
Spider,python your_spider.py