- Home
- Plugins
- Tools & Capabilities
- dsh-scrapling
dsh-scrapling
jayyuen666/dsh-scrapling
Wraps the Scrapling Python library in up to nineteen model tools, registered by probed capability: real-browser rendering for JavaScript-only pages, CSS/XPath extraction that returns structured data instead of Markdown, self-healing selectors, reusable login-state sessions with XHR capture and network history, page reads, screenshots, downloads, gated browser actions, a page-grounded answer tool and a domain-scoped crawler with content/sitemap/feed/Shopify modes on the official job backend. It can replace the built-in web_fetch / web_search, serve the same tool table over MCP, and screens every outbound URL against a public-address policy. Requires Python 3.14+ with Scrapling installed; the browser tools also need a Chromium engine for patchright, which an optional CLI installs on macOS arm64 only.
Install
dsh plugin --profile web add github:jayyuen666/dsh-scraplingREADME
dsh-scrapling
Scrapling web scraping for dsh: JavaScript rendering, structured extraction and a background crawler, behind one resident Python sidecar.
A web-scraping extension for dsh: Scrapling as agent tools — JavaScript rendering, CSS/XPath extraction with self-healing selectors, sessions with login state, a background crawler and page Q&A. You supply the interpreter and the browser engine; everything runs in one resident Python process.
Contents
- Contents
- What it does
- Install
- Runtime packs (macOS arm64)
- Verify it is live
- What it does not provide
- Enabling it in dsh
- The tools
- Replacing the built-in fetch and search
- MCP mode
- Settings
- Proxies
- Security
- Data and privacy
- Known boundaries
- FAQ
- Development
- Feedback
- License
What it does
dsh ships web_fetch and web_search. The built-in web_fetch is deliberately honest and minimal: a plain HTTP(S) GET with no JavaScript execution and an honest User-Agent. That is a good default — and it means a single-page application yields only its loading shell, and there is no way to ask for "just the product table". Measured on a page whose content exists only after JavaScript runs:
| Pipeline | Text obtained |
|---|---|
| raw HTML to text (no JS) | SPA Shell / LOADING_PLACEHOLDER |
Fetcher (curl_cffi, still no JS) | SPA Shell / LOADING_PLACEHOLDER |
| browser render (patchright) | full rendered DOM, Markdown table, structured rows |
This package adds what the built-ins structurally cannot do:
- Browser rendering — JavaScript execution via patchright.
- Structured extraction — CSS/XPath selection returning data, not a wall of Markdown.
- Self-healing selectors — Scrapling's
adaptivemode relocates an element after the site's markup changes; a selector that returnsNoneafter a class rename returns the relocated element withadaptiveon.
Everything runs against one long-lived Python process. That is not an optimisation: Scrapling's session classes keep cookies, the browser engines keep a page pool, and adaptive keeps a SQLite fingerprint database — a process per call would throw all of that away. Tools are registered conditionally: the plugin probes what the environment can actually do at startup and registers only what will work, so the model never burns a turn on a tool that was guaranteed to fail. Every tool renders its result row through the official tool-call view slot. scrapling_answer is the only tool that spends another model call — see The tools.
Install
dsh plugin --profile web add @jayyuen66/dsh-scrapling
Remove with dsh plugin --profile web remove @jayyuen66/dsh-scrapling. The package is on the public npm registry, so installation needs no credentials and no scoped-registry line.
- Requires Node.js
^24.22.3 || >=26.13.1. This is an ESM-only package, and the build entry points (build-client.ts,build-host.ts,build-cli.ts) are executed bynodedirectly, so the floor has to sit where TypeScript type stripping is on by default (Node 22.18 up). The range itself is the host floor:0.2.3hosts fromalpha.2declare Node^24.22.3 || >=26.13.1(Node 25 sits outside it), and a host below it never starts. - Requires host
dshat the0.2.3-alpha.2line or later. The requirement the host actually reads isengines.dsh(^0.2.3-alpha.2), and it decides alone; a host on a later line is refused and needs the explicit risk grantdsh plugin --profile <p> allow-version <pkg>@<ver> --dsh-version <exact> --accept-risk. The support window rolls: this package is verified against every released host version inside the window at publish time and re-verified once the window moves, so the version number in this bullet is not a standing promise. - Requires Python 3.14+ with Scrapling installed — named by
pythonBin, or found by the fixed chain inlib/runtime.ts(the managed venvdataDir/runtime/venv, then the bare managed interpreterdataDir/runtime/python/<version>, then the repository's_env/.venv, thenPATH). In an installed package the_env/.venvleg does not exist, so aftersetup --feature core --applythe interpreter is the managed venv and otherwise thepython3on yourPATH(pythonon Windows); whichever one is chosen is logged at load time, and a missing Scrapling reports an error carrying the install line to copy. The two managed legs are not interchangeable: the installer drops a managed CPython and then createsruntime/venvfrom it, and every wheel (Scrapling, patchright, the official MCP server) goes into the venv — the bare interpreter has no packages at all, so using it would fail every import while the logged path still looked right.
pip install "scrapling[rag]>=0.5,<0.6"
python -m patchright install chromium
- Why
ragand notfetchers:ragisfetchersplusmarkdownify, and the defaultextractionTypeismarkdown— with plainfetchersthe first fetch raisesModuleNotFoundErrorat the Markdown conversion. - Version range: developed and verified against Scrapling 0.5, through interfaces that are not stable API surface (
Selector,Spider,SessionManager, and the converter's noise-stripping helpers). The upper bound is pinned below0.6; outside the range the guards still run, but the anti-injection cleaning and the crawl path may not behave as documented. In 0.5 the browser backend is patchright only (the old standalone stealth fetch is gone; its anti-detection arguments live onscrapling_render),capture_xhrbecame session-level recording (hencescrapling_session_network), andextra_flagsbecame additive — this package sends none, and WebRTC leak protection is carried by theblockWebrtcswitch. - Without the installer, the browser engine is yours. The optional CLI can install the verified macOS arm64 set; the plugin itself downloads nothing at load time. Without a browser it simply does not register the browser-dependent tools, so the model never wastes a turn calling them.
- PDF reading is optional. Install the
documentspack for pinned pypdf 7.1.1, or install the same version into the interpreter selected bypythonBin. Without pypdf the sidecar still starts,capabilities.documentsis false, andscrapling_read_documentis not registered. - No
@deepseek-ai/*underdependencies, by contract (test/publish-manifest.test.tsenforces it). Consumer profiles install withnodeLinker: hoistedandautoInstallPeers: false, so a host package there becomes a real second copy whose module-level state splits from the running host's — every native tool call then throws while build and tests stay green. The host packages the artifact imports for value are required peers and stay externalized; the gate imports the built artifact and asserts that no host package body is inlined. - The artifact is ESM-only and never committed —
prepackrebuilds it, so what ships is always what the current source produces.
Shared version floor
If your profile pins @jayyuen66/dsh-plugin-shared with a pnpm overrides entry, that pin must be at least the version this package declares. A lower pin installs a copy without the names the sources use, and the host then reports N entries did not activate together with does not provide an export named ... at boot - the package installs fine and never loads, and no per-repository CI run can see it.
Runtime packs (macOS arm64)
The package ships bin/dsh-scrapling.mjs. It installs the ability packs into dataDir/runtime (default ~/.dsh-scrapling) — never into system Python and never into the user's Playwright cache. There is no postinstall; nothing is downloaded when the plugin loads.
dsh-scrapling setup --feature core --apply
dsh-scrapling setup --feature browser --apply
dsh-scrapling setup --status
coreinstalls managed Python 3.14.9, Scrapling 0.5.1 and its pinned wheels;browseradds the full Chromium build (not the headless shell).search,media,documents,mcpandadaptive-redisall ride oncore's venv:documentsadds pinned pypdf 7.1.1 from its own hash-locked requirements file,mcpbrings the officialscrapling-mcpserver (the pinnedmcppackage; its tool set is the upstream's, not this plugin's) thatofficial-mcpmode needs, andadaptive-redisbrings theredisclient behindadaptiveStorage: redis. All seven packs are installable; the settings card reports each asready,missing,corruptorinstalling.--featureis a dry run by default;--applywrites.--repairre-installs without touching user data, and--uninstall <pack> [--purge]removes runtime files; only--purgeremoveselements_storage.dbanddownloads/.--offline <dir>installs with no network at all:<dir>must hold the Python archive named exactly as the manifest URL's last segment (browser andcurl -Oboth keepcpython-3.14.9+…-install_only.tar.gz, and the percent-encoded spelling is accepted too) plus awheels/directory with one wheel per pinned requirement -pip download --only-binary=:all: --require-hashes -r py/runtime-requirements.txt -d <dir>/wheelsproduces the core set; add-r py/documents-requirements.txtwhen installing thedocumentspack. The hash check on the Python archive is the same one the networked path runs, and pip is invoked with--no-index; a missing archive or wheelhouse fails asINSTALL_OFFLINE_ASSETSinstead of silently going online.setup --statusprints one JSON document:dataDir,profile,runtime,packsandstate. With--profile <dir>it reads that profile'scordis.patch.yml, resolves the interpreter from this package'spythonBinand the data directory fromdataDir(the two settings the host actually uses);packsandstateare then reported for that directory — when the entry carries nodataDir, both fall back to the CLI's own default. Without--profile,profile.pathisnull, a note says the profile was not read, andruntimefalls back to the CLI's own chain (managed venv → bare managed interpreter → repo_env/.venv→ PATHpython3). Pass--profilewhenever you compare the card's interpreter with what--statusreports.- The settings card can start the same install/repair/cancel actions through the
scraplingRuntimeremote when the profile has both a remote surface and a jobs backend; otherwise it prints the CLI command. integrationModeis deployment-only; on a host that exposesmcpManager(the rc.2 web bundle) the MCP server is registered dynamically at load, whilesetup --modeprints or writes the client entry for CLI/headless profiles anddoctorchecks a profile against it — see MCP mode.official-mcpstartsscrapling-mcpfrom the managed venv, which themcppack provisions (setup --feature mcp --apply).- Only macOS arm64 is verified. Windows, Linux and macOS x64 are blocked (B1/B2): every pack reports
blockedand the installer refuses rather than guessing an asset path.
Verify it is live
- The layer is mounted.
dsh --profile web --dump-configshows this package's layer line.- That command is the only accepted "it is in the layer stack" signal, and it is not read-only — it rewrites the profile's root assembly file. Read layer lines from stdout and check stderr separately: an unmatched patch target appears only on stderr, so the exit code alone proves nothing. Accept both
# == <layer>and# == <layer>, patched by <path>.
- That command is the only accepted "it is in the layer stack" signal, and it is not read-only — it rewrites the profile's root assembly file. Read layer lines from stdout and check stderr separately: an unmatched patch target appears only on stderr, so the exit code alone proves nothing. Accept both
- The startup log names the interpreter and the plan. One line prints the probed capabilities and how many of the tools registered; the chosen interpreter path is logged at load. An interpreter that starts but lacks Scrapling is named in the log together with the pip line to copy.
- The settings card renders. The plugin detail page carries the scrapling card with every user-editable field grouped by purpose; toggling a value enables Save, and the write returns 200.
- A tool round-trip. Ask the model to fetch a JavaScript-heavy page: the result row renders in the chat through the official tool-call view. On a machine without a browser the render / capture_xhr tools are absent from the model's tool list and their guidance is gone from the skill body too — that absence is the conditional registration working, not a failure.
What it does not provide
- It is not a search engine. Discovery uses one of seven backends (
searchBackend:auto/tavily/bing/brave/serper/duckduckgo/searxng/deepseek). Six run in the Python sidecar and use their own settings;deepseekruns in Host through optionalctx.deepseekAuthand the direct Search API. Scrapling's owngoogle_searchoption only sets a referer header. A selected backend without credentials reportsSEARCH_AUTHinstead of silently switching. - The npm tarball bundles no interpreter or browser. They come from your machine or from the optional CLI installer, which downloads the verified macOS arm64 set into
dataDir/runtime; missing pieces remove the matching tools instead of being fetched at load time. - It adds no HTTP route on the host side. The settings card is a host config form and this package exposes no
/apisurface. The one socket that really listens is the MCP server underintegrationMode: mcp, bound to127.0.0.1(http://127.0.0.1:<mcpPort>/mcp): any other path gets 404, a declared body over 1 MiB gets 413, a request withoutContent-Lengthgets 411, and the bearer token is read only fromDSH_SCRAPLING_MCP_TOKEN— with no token set, startup prints a stderr notice that the endpoint is unauthenticated and reachable from any local process. - It adds no dsh subcommand. The package's own
dsh-scraplingCLI manages runtime packs, plus the manual half of the MCP hookup for profiles withoutmcpManager:setup --mode native|mcp|official-mcpgenerates the client entry and, with--apply, writes it to<dataDir>/mcp/<mode>.patch.yml(the profile itself is never touched), whiledoctor --modecompares that entry against the profile'scordis.patch.ymlitem by item. Given--profile,setup --statusreadspythonBinanddataDirfrom that same file.
Enabling it in dsh
dsh.bundle.patchpoints atcordis.patch.yml, which carries a- id: dsh-plugin-sharedsupplier row (keep it enabled; disabling it removes the cards' shared component supply) plus the- id: scraplingentry with the bare package name — the host scansdsh.clienton bare package-name entries only. The card components come from the shared client row, externalized as@jayyuen66/dsh-plugin-shared/client; the host module table providesreact,zodand that shared row.- The client half registers two surfaces: the settings card (on the
plugins.bundle.configslot, keyed by the bundle package name — the host dispatchesentryKey: pkg.name, so the card renders on this package's detail page) and one result row per tool ontool.call.toolview, drawn with the official tool-call view props. - The settings namespace is the entry id
scrapling; precedence is settings-card value > registration-lineconfig:> schema default. Setting a field back to its default saves a clear-override, not a write of the same value, so a later default change still reaches you. - Most card values are read per call — extraction and browser knobs, the five output budgets,
fetchTimeoutMs,answerMaxTokens, the answer route and the search-provider settings — so a saved change reaches the next tool call. The assembly-time set needs a restart: the sixteen tool switches,provideWebFetch/provideWebSearch,pythonBin,failFastOnMissingPython,dataDir,sidecarHandshakeTimeoutMs/sidecarGraceMs, and the URL-gate / sidecar-environment values (proxyUrl,proxyBypass,allowedHosts,nat64Prefixes,syntheticDnsRanges). - Disabling a tool also removes its guidance, in two layers: the resident section is a single summary (cross-tool selection rules, naming no specific tool), while the sixteen per-tool lines are registered as a virtual skill
scrapling. Both are re-read at each prompt assembly against the tools that scope can actually see — a machine without a browser loses the render / capture_xhr lines from the skill body, and a sidecar that never came up gets neither the section nor the skill (registering an empty skill would only put a catalog entry that opens to nothing). Without the host's skill service (a trimmed profile) the plugin still composes normally, it just lacks that skill and the summary drops its "full guidance lives in the skill" pointer. The section is placed next to the built-inweb_fetchguidance. scrapling_crawlregisters its own job kind, sojob_listlabels its jobs as crawls rather than shell jobs.
The tools
Twenty tools, behind sixteen settings switches (the seven session/state tools share switches), all exercised by the test suite:
| Tool | Backend | Needs a browser | Concurrency |
|---|---|---|---|
scrapling_fetch | Fetcher (curl_cffi) | no | concurrent; write verbs are serialised once allowWriteMethods is on |
scrapling_extract | Selector + CSS/XPath + adaptive | no | concurrent |
scrapling_locate | text / regex / similar-element lookup; returns generated selectors | no | concurrent |
scrapling_links | LinkExtractor plus next-page candidates | no | concurrent |
scrapling_render | StealthySession (patchright) | yes | serialised; the anti-detection switches (solveCloudflare / hideCanvas / blockWebrtc) live here |
scrapling_capture_xhr | one throwaway session, page-level recording | yes | serialised |
scrapling_session_open / scrapling_session_fetch / scrapling_session_network / scrapling_session_state_save / scrapling_session_state_load / scrapling_session_list / scrapling_session_close | Scrapling session classes | browser sessions only | serialised |
scrapling_session_read | current DOM text or AI-mode ARIA snapshot of a browser session page | yes | serialised |
scrapling_session_act | structured actions, including selector/coordinate drag, on a session page (deployment gate) | yes | serialised |
scrapling_download | byte download into dataDir/downloads (deployment gate) | no | concurrent |
scrapling_read_document | streamed PDF text via optional pypdf | no | concurrent; defaults to 20 MiB / 200 pages / 200000 characters |
scrapling_screenshot | PNG/JPEG screenshot handed to the attachment service | yes | serialised |
scrapling_crawl | Scrapling Spider framework (content / sitemap / feed / shopify) as a job | no | serialised |
scrapling_answer | any fetch path plus ctx.llm | with render: true | serialised |
- Quotas. At most 8 open sessions (3 of them browser sessions;
stealthlaunches local Chromium whileremoteconnects to CDP), 2 crawls in flight, per-page bodies clipped by*MaxOutputChars, 8 MB per protocol frame, 16 queued frames. A ceiling answers with a specific code (SESSION_LIMIT/CRAWL_BUSY/BAD_FRAME) the model can back off from. scrapling_crawlreturns a job id immediately — a crawl takes minutes and a tool call has a timeout. Watch it withjob_list, read it withjob_output, stop it withjob_kill; the tool needs a jobs registry that can attach a controller, and a profile without one simply does not register it (single-page fetching is unaffected). The crawl has a wall-clock ceiling (crawlMaxRuntimeSeconds) and never leaves the start domain. Politeness defaults follow Scrapling's spider defaults — robots.txt is not obeyed, per-domain delay is 0, up to 4 requests run in parallel — and is a deployment decision, not a per-call one (see Settings).scrapling_answerfetches the page first, then hands the text plus your question to a model and returns the conclusion instead of the whole page. It follows the model the current session is already using by default (read from the session's live request header, so a mid-session model switch is picked up), which burns no separate quota; pinanswerProvider/answerModelto route page-reading elsewhere. Page text is untrusted input — the prompt frames it explicitly as data, but that defence is prompt-level: it lowers the risk, it does not remove it.
Browser sessions, ARIA and drag
sessionType=remote appears only when the sidecar reports RemoteSession support and deployment config sets browserCdpUrl to a ws://, wss://, http:// or https:// endpoint. It connects to an already-running Chromium and creates an isolated context; it does not need a local Chromium install. The endpoint is a strong capability and never enters model input. Closing the session releases that context and connection.
scrapling_session_read accepts snapshotType: "text" | "aria" (default text). ARIA uses Patchright's AI-mode accessibility snapshot and can be narrowed with cssSelector, which makes buttons, links and form controls easier to locate than raw DOM text.
scrapling_session_act adds type: "drag" in two exclusive forms: { "type": "drag", "from": "#source", "to": "#target" } or { "type": "drag", "fromX": 10, "fromY": 20, "toX": 100, "toY": 80 }. It still requires allowBrowserActions: true; URL guards and the action gate apply to remote and local browser sessions alike.
Render or static
scrapling_render is much slower and heavier than scrapling_fetch, so start static. Two criteria:
- If the rendered result is shorter than the static fetch, go back to static. Plenty of sites ship readable text from the server and then have their own script empty those containers and swap in canvas / Lottie animation — for those pages rendering can only lose content, and no wait setting brings it back. That is site behaviour, not a plugin defect.
waitSelectorwaits for an element to appear, not for content to settle. The element can be removed after it matched, so "the selector matched" does not mean the content is in the result.
One thing that is not a criterion but worth knowing: axis ticks inside SVG cannot be fetched at all — the Markdown conversion emits no <svg> / <text> nodes, so chart numbers are out of reach whichever tool you use. For actual values, go through scrapling_capture_xhr to locate the JSON endpoint.
Replacing the built-in fetch and search
The plugin registers itself as a fetch provider and a search provider on ctx.web, so the built-in web_fetch / web_search tools actually run on Scrapling instead of dsh's plain-HTTP implementation. The model still calls web_fetch / web_search — tool names cannot be swapped (same-name registration throws), the provider seam is the supported channel. Both providers are registered by default (provideWebFetch / provideWebSearch), but that alone displaces nothing:
- leave
provideWebFetch/provideWebSearchat their default (true); - set
fetchProvider/searchProviderto"scrapling"in the deployment config.
Both content-reading paths share webFetchStrategy (default auto): static always reads statically; auto reads statically first and renders only when the body is under 200 characters; browser renders directly. Without a browser, auto stays static. A network error or malformed reply is returned as a failure, not treated as a reason to render.
A configured id wins over auto-selection, which is why step 2 is required — and with two usable providers and no id named, ctx.web answers WEB_PROVIDER_AMBIGUOUS and the tool becomes unavailable outright. Two consequences of pointing that line at this plugin:
- If the sidecar cannot start, the built-in
web_fetchreportsWEB_PROVIDER_CONFIGURED_UNAVAILABLErather than quietly falling back to plain HTTP. - If you later remove the plugin but leave the line in, the built-in tools report
WEB_PROVIDER_CONFIGURED_MISSING— go back and removefetchProvider/searchProvidertoo. - The fetch provider really applies the output budget: a body over
fetchMaxOutputCharsis cut to a head/tail window and flaggedtruncated, not passed through with a flag. Failures keep the sidecar code prefix (URL_BLOCKED,SIDECAR_TIMEOUT,SIDECAR_UNAVAILABLE), so a policy refusal is distinguishable from a crash or a timeout.
Search is split in two, because Scrapling is not a search engine: an omitted maxResults defaults to 10, matching dsh's web_search; discovery uses searchBackend — Tavily, Bing HTML, Brave (API), Serper (API), DuckDuckGo HTML, SearXNG (JSON API), or DeepSeek's direct Search API through optional ctx.deepseekAuth; reading remains this plugin's — the first searchRenderTopN results are fetched according to webFetchStrategy, so one web_search call returns both which pages matter and what they say. auto keeps the existing Tavily → SearXNG → explicitly allowed public-engine order; DeepSeek is selected explicitly with searchBackend=deepseek. Without a configured discovery path the provider is unavailable and web_search reports SEARCH_BACKEND_MISSING instead of querying anyone. Only Tavily and Bing have been exercised against real endpoints here; the other sidecar backends use documented shapes and local stubs. DeepSeek is covered by authorization/HTTP contract tests, not a live credentialed request. Every returned URL goes through the same gate as a fetch; a page that fails to read is skipped alone.
Source URLs are canonicalized before citation: fragments and common tracking parameters are removed, query keys are sorted, and duplicate URLs keep their first result. Provider-supplied summary and publishedAt fields are preserved. MCP search also accepts offset (0–100): backends with native pagination use it, while DeepSeek has no offset parameter and the plugin requests up to 50 results before slicing locally. Successful discovery results are cached in memory for 300 seconds with at most 128 entries; cache keys include the query, page, backend and redacted endpoints, never API-key values or authorization headers. The direct DeepSeek branch paces at 5 requests per second per provider instance; other processes sharing the account are not coordinated. Every discovery backend follows the same proxy policy as fetching, including an explicit direct connection for proxyBypass: "*". Bing uses setlang=zh-hans for Chinese queries and setlang=en otherwise, and unwraps its ck/a redirect links to the original URL.
One consequence to know: dsh-web's fetch body is a closed union of html | text with no markdown kind, and adding one is a cross-package change a plugin cannot make. The fetch provider therefore reports Scrapling's Markdown as text, which the built-in renderer displays normally. Use scrapling_fetch directly when you need html or a CSS selector.
MCP mode
integrationMode selects one of three mutually exclusive tool surfaces. It is deployment configuration (the config: block of cordis.patch.yml), it is read once when the plugin is assembled, and changing it requires a restart.
mcpToolLoading is deployment-only too and defaults to eager, which keeps the existing behavior of putting the server's tools directly into the tool list. Set it to on-demand when those definitions are too large to send with every request: the system prompt then lists each raw tool name with the first line of its description, and the model loads what it needs through mcp__scrapling__load_tools. Loaded tools join only the calling agent's list; subagents, forks and resumed sessions start empty. The value is passed to both dynamic mcpManager registration and setup-generated manual entries as toolLoading; changing it requires a restart. For a manual entry, also rerun setup --mode <mode> --profile <profileDir> --apply and reapply the generated patch — restarting alone does not rewrite that entry.
| Mode | What it registers |
|---|---|
native (default) | the scrapling_* tools listed above |
mcp | no native tools; the plugin serves the same tool table over MCP |
official-mcp | no native tools and no server from this plugin; on a host that exposes mcpManager it registers the official scrapling-mcp dynamically, otherwise setup generates the dsh-mcp-client entry for it - it runs in its own process, with its own sessions, and without this plugin's URL guard |
In mcp mode the server runs inside the plugin's own host process and calls the same sidecar, so the URL guard, sessions, jobs and adaptive storage are the same ones the native tools use — there is no second implementation to drift.
- Endpoint
http://127.0.0.1:<mcpPort>/mcp(mcpPort, default39217). Only loopback is bound; a request whose declared body exceeds 1 MiB is refused with413, and any other path gets404. The server is stateless: each request gets its own protocol instance, so nothing survives across them. - Auth off by default. Set the environment variable
DSH_SCRAPLING_MCP_TOKENand every request must then carryAuthorization: Bearer <token>. The token is only ever read from the environment, never from the profile, so it does not land in a config file. - Tools are the same
ToolDefinitionobjects native registers: same JSON Schema, same argument validation, same renderers.scrapling_answeris not served — it routes through the model of the hosting session, which an external client does not have.searchexists only on this surface, because an MCP client has noctx.webseam; it acceptsquery,maxResultsandoffset, and returns citable URLs, snippets, optionalsummary/publishedAt, bounded body text andstructuredContent. The gates are identical: withallowBrowserActions=falsethere is nosession_act, withallowFileDownloads=falsethere is nodownload, andsearchis absent when no search backend is available. - Results are text content; a screenshot comes back as MCP image content instead of a host attachment. A failing tool returns
isErrorwith a readable message rather than dropping the connection. - Names: the MCP raw name is the tool name without the
scrapling_prefix, and dsh's MCP client shows it asmcp__scrapling__<raw>.
| Native tool | MCP raw name |
|---|---|
scrapling_fetch | fetch |
scrapling_extract | extract |
scrapling_locate | locate |
scrapling_links | links |
scrapling_render | render |
scrapling_capture_xhr | capture_xhr |
scrapling_session_open | session_open |
scrapling_session_fetch | session_fetch |
scrapling_session_network | session_network |
scrapling_session_state_save | session_state_save |
scrapling_session_state_load | session_state_load |
scrapling_session_list | session_list |
scrapling_session_close | session_close |
scrapling_crawl | crawl |
scrapling_session_read | session_read |
scrapling_session_act | session_act |
scrapling_download | download |
scrapling_read_document | read_document |
scrapling_screenshot | screenshot |
— (ctx.web only) | search |
On a host that exposes the mcpManager service (the rc.2 web/desktop bundle) the plugin registers its server there at load: no dsh-mcp-client install and no profile entry are needed, and mcpPort alone decides the endpoint. The manual entry below is for CLI/headless profiles, where that service is absent. If an upgraded profile still carries the manual entry, remove it when relying on dynamic registration - otherwise the manager refuses the duplicate server name and the old entry keeps serving.
Connecting dsh needs @deepseek-ai/dsh-mcp-client, which this plugin deliberately does not depend on. Pin the exact build matching the host version - npm latest is older than the host's own line, and the client's peer versions are literal, so one prerelease off installs but never activates. 0.2.3-alpha.2 is the default; a host still on rc.1 takes 0.2.2-rc.1, and next tracks the official beta line:
dsh plugin --profile <name> add @deepseek-ai/dsh-mcp-client@0.2.3-alpha.2
Then add one entry to that profile's cordis.patch.yml — this is exactly what dsh-scrapling setup --mode mcp prints, so you can also let the CLI write it (drop headers when no token is configured):
- insert:
- id: scrapling-mcp
name: '@deepseek-ai/dsh-mcp-client'
config:
serverName: scrapling
transport: streamable-http
url: http://127.0.0.1:39217/mcp
failOnStartupError: false
toolLoading: eager
# only with DSH_SCRAPLING_MCP_TOKEN set:
# headers:
# Authorization: !!js '`Bearer ${process.env.DSH_SCRAPLING_MCP_TOKEN}`'
mcpPort and that URL have to say the same thing; after changing the port, re-apply the entry.
failOnStartupError is false here on purpose: the port only starts listening once the plugin has finished handshaking with the Python sidecar, and the client throws its fiber on the first failed connect (Version negotiation probe failed: connect ECONNREFUSED → the host reports 1 entry did not activate). Its own reconnect is on by default (500ms backoff, 10 attempts), so a first-attempt refusal is meant to be absorbed - setting this to true would let fiber start order decide whether the mode works. The official stdio entry keeps true: there the client spawns the server itself, so a failed connect is a real failure and should be loud.
setup --mode and doctor
setup --mode writes that entry text; it never edits a profile. Without --apply it is a dry run, and with --apply it drops the text in <dataDir>/mcp/<mode>.patch.yml and prints the path - applying it to cordis.patch.yml stays your action, because the host offers no safe append API for that file (dsh --dump-config rewrites the profile's root config). Pass --profile <profileDir> to derive toolLoading from that profile's mcpToolLoading; without it, setup uses the backward-compatible eager default rather than introducing a second command-line source of truth.
dsh-scrapling setup --mode mcp --port 45991 --with-auth --apply
dsh-scrapling setup --mode native --apply # a file that deliberately contains no entry
dsh-scrapling doctor --mode mcp --profile <profileDir>
doctor reads what the profile actually says - cordis.patch.yml plus that profile's package.json - and prints one line per problem: two entries under serverName: scrapling, this plugin's entry next to an official stdio one, entries that do not match the mode, an entry whose port disagrees with --port, a profile without @deepseek-ai/dsh-mcp-client or with it pinned to something other than 0.2.3-alpha.2 / 0.2.2-rc.1 / next, and an official entry while officialMcpEnabled is off. Exit 0 is "consistent", 1 names at least one problem, 2 is a bad argument. integrationMode itself is a plugin setting the CLI cannot read, so --mode is the claim being checked and has to match the deployment.
setup for official-mcp asks for two separate statements before it writes anything: officialMcpEnabled: true in the profile and --accept-risk on the command line; missing either one prints OFFICIAL_MCP_DISABLED / RISK_NOT_ACCEPTED and writes nothing. At load time the host-side path is gated by officialMcpEnabled alone: a host exposing mcpManager registers the managed scrapling-mcp directly, while the setup-generated dsh-mcp-client entry is the fallback for CLI/headless profiles. Either path starts <dataDir>/runtime/venv/bin/scrapling-mcp, so run setup --feature mcp --apply first - see Runtime packs. When that binary is missing, setup prints a line saying so.
Settings
Settings live on the scrapling card in the plugin detail page, grouped by purpose, each field with a one-line "what changes if you edit this". The card's language follows the host locale. Values marked below live on the card; the deployment table after them is only settable through the config: block of cordis.patch.yml.
| Field | Type | Default | Purpose |
|---|---|---|---|
pythonBin | string | "" | Interpreter name or absolute path. Empty walks the fixed chain in lib/runtime.ts: the managed venv dataDir/runtime/venv (where setup --feature core --apply installs every wheel), then the bare managed interpreter dataDir/runtime/python/<version> (an install that stopped halfway), then the repository _env/.venv when usable (a source checkout only), then python3 on PATH (python on Windows) |
failFastOnMissingPython | boolean | true | Refuses to load when the sidecar process cannot start (wrong path, protocol mismatch, handshake timeout). An interpreter that starts but lacks Scrapling always degrades to "tools unavailable" with the path named in the log, whatever this switch says |
fetchEnabled / extractEnabled / locateEnabled / linksEnabled / renderEnabled / captureXhrEnabled / networkEnabled / sessionEnabled / sessionStateEnabled / crawlEnabled / answerEnabled / sessionReadEnabled / sessionActionsEnabled / downloadEnabled / documentsEnabled / screenshotEnabled | boolean | true | One kill switch per tool or tool pair. sessionStateEnabled gates the state save / load pair, which also needs a deployment-side sessionStateDir |
extractionType | enum | markdown | markdown / html / text; all three run the same anti-injection cleaning, and html additionally strips event-handler attributes, so it is not byte-for-byte raw HTML |
mainContentOnly | boolean | true | Extraction scope |
*MaxOutputChars | natural | fetch / extract / render / document 200000, xhr 120000 | Per-tool output caps. The sidecar clips by characters, the host then trims to a byte budget. scrapling_render and scrapling_capture_xhr carry XHR history in addition to the body, and that section is capped by the same budget separately — so one such call can return up to twice the budget |
crawlMaxItems | natural | 1000 | Ceiling over the model-supplied maxPages. An out-of-range maxPages is passed through so the sidecar reports the parameter error rather than this plugin silently clamping it |
stripInlineImages | boolean | true | Drops inline data: URI images from the body, keeping only alt text — pure token noise for the model. Code fences are left untouched; pages without inline images come back byte-identical. Stripping happens before the cap. Turn off only when the raw base64 is the data (colours, fingerprints) |
headless / networkIdle | boolean | true / false | Browser mode and whether a page must reach network idle before it is read |
blockAds | boolean | true | Stacks on top of the SSRF guard rather than competing with it: the guard is registered last (so the engine runs it first) and yields with route.fallback() |
pierceShadow | boolean | false | Merges open shadow roots into the body — the switch for pages that hide their text in shadow DOM. The model can also override it per call on the browser tools |
waitSelectorState | enum | attached | The state a waitSelector element must reach (attached / detached / hidden / visible) |
sidecarHandshakeTimeoutMs / fetchTimeoutMs / sidecarGraceMs | natural | 30000 / 120000 / 5000 | Handshake budget, per-call cooperative timeout (declared on the tools' timeoutMs), and how long the client waits for the process to exit before forcing it down. scrapling_crawl passes no timeout — a crawl is measured in minutes |
dataDir | string | "" | Sidecar working directory (the adaptive fingerprint database lands here); empty = ~/.dsh-scrapling. If it cannot be created, failFastOnMissingPython decides whether the plugin refuses to load or degrades to no tools |
provideWebFetch / provideWebSearch | boolean | true | Whether the ctx.web providers are registered at all — see Replacing the built-in fetch and search |
webFetchStrategy | enum | auto | static always reads statically; auto reads statically first and renders only when the body is under 200 characters; browser renders directly. Without a browser, auto stays static. Network and protocol failures do not trigger rendering |
searchMaxOutputBytes | number | 24000 | UTF-8 byte cap across all body sections returned by one search; raising it increases context and token cost |
searchBackend / tavilyApiKey | enum / secret | auto / "" | Discovery backend (auto / tavily / bing / brave / serper / duckduckgo / searxng / deepseek) and the Tavily key. deepseek uses optional Host ctx.deepseekAuth; other backends keep their own credentials. auto retains Tavily → SearXNG → explicitly allowed public fallback |
searchPublicFallback | boolean | false | Lets auto fall back to the public Bing engine when neither a key nor SearXNG is configured — py/search.py resolves auto in the order tavily → searxng → bing. DuckDuckGo is not reachable through auto at all; name searchBackend=duckduckgo to use it. Off by default on purpose: turning it on sends query strings to a third-party public engine |
braveApiKey / serperApiKey | secret | "" | Keys for the Brave Search and Serper.dev backends |
searxngEndpoint | string | "" | Base URL of a SearXNG instance (…/search?format=json is appended); empty means the backend is unusable and reports SEARCH_AUTH |
answerProvider / answerModel / answerMaxTokens | string / natural | "" / "" / 2000 | The model scrapling_answer routes to and the per-reply token cap. Provider and model left empty mean "follow the model the current session is already using" |
allowedHosts | string | "" | Extra host names that skip the public-address check (comma-separated). Pointing it at an intranet address means giving up SSRF protection for those targets on purpose |
syntheticDnsRanges | string | "" | Manual fallback for synthetic DNS: a comma-separated CIDR list of your proxy's fake-IP pool, for resolvers that mix synthetic and real answers. Invalid entries are dropped — a broken fallback degrades to "stay strict", not to a crash |
proxyUrl | string | "" | Where fetches go out (http://… / socks5://…, optionally user:pass@). Empty = follow the environment; see Proxies. Masked on the card, never enters a tool schema |
proxyBypass | string | "" | Host names that connect directly, mirroring NO_PROXY; * means the whole machine goes direct |
nat64Prefixes | string | "" | Extra NAT64 prefixes (comma-separated <IPv6 prefix>/<32|40|48|56|64|96>) for operator-specific networks. A declared prefix is consulted for every IPv6 answer and applies to the addresses inside it. A malformed entry makes the plugin refuse to load (CONFIG_INVALID), unlike syntheticDnsRanges below: dropping a prefix would let a private IPv4 embedded in IPv6 through as ordinary public IPv6 |
Deployment-only knobs (not on the card; set them in the config: block of cordis.patch.yml):
| Field | Default | Purpose |
|---|---|---|
requestTimeoutSeconds / maxUrlLength | 120 / 2048 | Python-side per-request ceiling; URL length cap aligned with the built-in fetch |
allowWriteMethods | false | Whether the model may change state on a remote host at all — see Security |
mcpToolLoading | eager | eager registers MCP tools directly; on-demand keeps them out of each agent's tool list until mcp__scrapling__load_tools loads them. Passed to dynamic registration and manual entries as toolLoading; restart required, and manual entries must be regenerated with setup --mode --profile |
browserExecutablePath / browserInitScript | "" | Strong capabilities: they hand Chromium a file to execute, or inject a JS file into every page. Deployment config only, unreachable from model input |
browserCdpUrl | "" | CDP endpoint for sessionType=remote; accepts ws/wss/http/https. Empty hides remote sessions. Deployment-only and never included in tool schemas or logs |
browserRealChrome / browserDnsOverHttps | false | Use the locally installed Google Chrome; route the browser's DNS over HTTPS (useful with a proxy to avoid DNS leaks) |
recordRequests / maxRecordedRequests | false / 100 | Whether browser sessions record network history by default (the model can turn it on per session with recordNetwork), and how many entries a session keeps |
sessionStateDir | "" | Directory for Playwright-compatible login-state files. The model can only pass a plain file name, so the directory stays a deployment decision; empty disables the state save / load pair |
adaptiveStorage | sqlite | Where adaptive fingerprints live: sqlite (one file under dataDir) or redis (one keyspace, shareable across processes and hosts). Deployment-only - the model only ever says "save" or "relocate" |
redisUrl | redis://127.0.0.1:6379/0 | Connection string read when adaptiveStorage: redis. The password never reaches logs or error text; an unreachable server fails as ADAPTIVE_STORAGE_UNAVAILABLE |
crawlMaxRuntimeSeconds | 1800 | Wall-clock ceiling of one crawl — the page cap says nothing about a site that takes a minute per page |
crawlRespectRobots | false | Obey robots.txt; with it on, a domain whose robots.txt fetch fails (network error or HTTP 5xx) is blocked rather than assumed permitted, while a missing robots.txt (HTTP 404, the common case) is treated as allowing everything |
crawlDownloadDelayMs / crawlConcurrentRequests / crawlAutothrottle / crawlStrategy | 0 / 4 / false / bfs | Gap between requests, parallelism, adaptive throttling, breadth- or depth-first order |
crawlCheckpointDir | "" | Persist the crawl queue so a restarted crawl resumes instead of going back to the start URL |
tavilyApiEndpoint / bingEndpoint / searchRenderTopN | https://api.tavily.com/search / https://www.bing.com/search / 3 | Discovery endpoints (overridable for tests or proxies), and how many results are actually read according to webFetchStrategy (0 = link list only) |
duckduckgoEndpoint | https://html.duckduckgo.com/html/ | DuckDuckGo HTML endpoint; override for a mirror or a test stub |
deepseekSearchEndpoint | https://api.deepseek.com/v1/tools/search | DeepSeek direct Search API endpoint. HTTPS only, no embedded credentials; changing it requires restart |
allowBrowserActions / allowFileDownloads / downloadMaxBytes | false / false / 10485760 | Deployment-only gates for structured actions and persistent downloads, plus the per-download byte cap. Both gates default off and also hide their tools from the model |
documentMaxBytes / documentMaxPages | 20971520 / 200 | Hard ceilings for PDF reads. Model arguments may only lower them; PDF bytes stream to a temporary file that is deleted on every path |
Proxies
Where a fetch goes out, resolved in this order — first hit wins:
proxyBypassor the environment'sNO_PROXYmatches this host -> direct.proxyUrlon the settings card is non-empty -> use it.http_proxy/https_proxy/all_proxyin the environment (upper case works too) -> use the matching slot.- The operating system's proxy settings (
scutil --proxyon macOS, Internet Settings on Windows) -> use them. - Neither -> direct.
What that looks like in practice — with or without a proxy, the tools just work, with no setting to fill in:
| Your setup | Static fetching | Render / XHR |
|---|---|---|
| No proxy | direct | direct |
| TUN mode (system-wide) | direct, forwarded by the TUN | same |
HTTPS_PROXY exported in the shell | follows it automatically | follows it automatically |
| macOS / Windows "system proxy" switch | follows it automatically | follows it automatically |
| Intranet targets / internal Git | exclude with proxyBypass | exclude with proxyBypass |
| PAC (auto-config script) | not followed; stderr says to set proxyUrl | followed natively by the browser |
Details worth knowing:
- The resolved proxy is handed to the browser engine explicitly. Chromium does not read
HTTP_PROXY/ALL_PROXY, so a proxy that is only exported in a shell would cover static fetches but not the browser — this package closes that gap by passing the resolved proxy on every browser fetch. A browser session still picks its proxy once, atscrapling_session_open: switching it means a new browser context, which throws away the session's cookies and login state — precisely the reason a session exists. Static sessions decide per request. - PAC is the one shape that needs a hand-filled
proxyUrl. Evaluating a PAC script means downloading it and running JavaScript, and the dialects differ per platform, so this package does not guess; static fetching says so on stderr, and the browser follows PAC natively through its own system settings. - A proxy and synthetic DNS are two different problems. A fake-IP proxy resolves every domain into
198.18.0.0/15(TUN clients often100.64.0.0/10); neither is public unicast, so the gate would reject every URL — turning a proxy on would stop the plugin from working. The gate detects that class of resolver on its own (three control names unrelated to any target, all landing in one non-public pool while staying distinct) and then relaxes to the whole of the known pools. The control names only trigger the verdict, never size the pool — three hashed answers carry no size information. Private, loopback and link-local ranges are in neither pool, so intranet and metadata addresses stay blocked on a proxied machine.syntheticDnsRangesis the manual fallback for a self-built pool outside the two ranges; when detection does not fire, the gate stays strict. - Through a proxy, a host name this machine cannot resolve is no longer rejected. The proxy resolves it, and on a network with DNS filtered by region those are exactly the sites that need a proxy. IP literals, private answers the local resolver can produce, and single-label host names (
intranet,router) stay rejected. - WebRTC leaks are closed whenever a proxy is in play. Chromium's WebRTC can send UDP around an HTTP/SOCKS proxy, and one STUN call in a page is enough to learn the visitor's real exit address;
blockWebrtcis forced on with a proxy, no model input involved. - Credentials never reach a log or the capability frame. The report echoes
scheme://host:portonly, with asourcefield (settings/environment/system/none) — the first column to read when someone reports that fetching does not work. A malformed proxy address is logged to stderr and treated as "not configured" rather than failing the load. - The installer's stderr and download URLs go through the same redaction gate. When pip fails it echoes the index URL back verbatim (measured:
WARNING: The index url "ht!tp://user:TOKEN@host/simple" seems invalidandInvalidURL: … 'https://user:TOKEN@/requests/'are both cleartext), while putting a token intoPIP_INDEX_URLis routine for corporate mirrors andspawnpasses the parent environment straight through.lib/installer.tsroutes all six stderr channels (curl / HTTP status / tar / venv / pip / chromium) and both download URLs throughsafeStderr()→redactUrlSecrets(), replacing the whole userinfo segment with***@;lib/url-policy.tsno longer anchors its match at line start, so a URL sitting mid-sentence is recognised too. Only the credential is masked — the diagnostic text survives, so the failure reason still reads.
Security
- SSRF. Scrapling itself has no SSRF protection. This package adds a URL policy on the host side — scheme allowlist, rejection of URLs with embedded credentials, length cap, rejection of an authority containing a backslash or control characters, DNS resolution with a whole-answer-set public-address check, IPv4-mapped and NAT64 addresses reclassified by their embedded IPv4 — and enforces the scheme, credential and address rules again on the Python side (the length cap stays with the host policy, because it is a deployment setting). Outbound paths accept only
http/httpsand reject embedded credentials;ws/wssare judged by address alone in the WebSocket-handshake check. What is judged is what gets sent: the gate decides on the WHATWG-normalised form and the sidecar forwards that same string, otherwise "judged A, connected to B" would be a bypass in its own right. The host-side policy is enforced in one place (SidecarClient.call), and that one place screens every URL the model hands over as something to fetch —url, plus crawl'ssitemapUrlandfeedUrl— with one deliberate exclusion: the three offline parsers (scrapling_extract,scrapling_locate,scrapling_links) send theirurlto the sidecar as nothing but the base for resolving relative links, solib/sidecar.ts(BASE_ONLY_METHODS) does not screen it and no request is made with it — so it covers every tool and theweb_fetchprovider alike, with a rejection throwingURL_BLOCKEDbefore the request reaches the pipe; theweb_searchprovider runs the same gate over the URLs it is about to return, so a hit the gate rejects never becomes a citeable source. The browser-side guard covers navigation, subresources, XHR and WebSocket handshakes. - Known gaps, stated in the open:
- Connection pinning (an undici-level technique) is unavailable for a non-Node transport, leaving a TOCTOU window between validation and connect. Static fetches are covered by curl_cffi's
follow_redirects="safe"; browser fetches by a route handler on the Python side. - NAT64 prefixes are not discovered dynamically. The two standardized prefixes are covered; operator-specific ones must be declared via
nat64Prefixes, otherwise a private IPv4 hidden inside IPv6 is judged as an ordinary public IPv6. - No port allowlist (any port allowed by default), matching dsh's own built-in fetch provider.
- The crawl re-checks every page twice before it enters the result set — once against the guard (the final URL may still have landed somewhere private) and once against the start domain, because Scrapling's
allow_domainsis a string comparison over links found in the page, not redirect targets. The crawl session usesfollow_redirects="safe"so curl_cffi refuses a jump into a private range. - WebSocket coverage depends on the Playwright version. The guard intercepts handshakes via
route_web_socket; older builds lack that method, WebSocket is then outside the guard, and the plugin reports that aswebsocketGuardin the handshake capabilities (the startup log prints the probed capabilities) rather than degrading silently.
- Connection pinning (an undici-level technique) is unavailable for a non-Node transport, leaving a TOCTOU window between validation and connect. Static fetches are covered by curl_cffi's
- No code execution from model input.
page_action,page_setup,selector_config,proxyandexecutablePathnever appear in any tool schema, and the browser-side network guard is installed by plugin code. The strong browser capabilities andallowWriteMethodscome only from deployment config. - Write verbs are off by default. With
allowWriteMethodsoff,methodandbodyare absent fromscrapling_fetch's parameter surface, and the sidecar independently refuses a non-GET withWRITE_DISABLED— two halves that do not rely on each other. The gate, the proxy decision andfollow_redirects="safe"bound where a request goes, not what it does once there; prompt-injected page text can ask for a POST, so turn it on only where the task really is to submit data.headersandcookiesstay available either way — anything handed to them lands in the model context by design. - Prompt-injection scrubbing runs unconditionally on all three extraction paths; there is no model-facing switch to turn it off.
Data and privacy
| Aspect | Content |
|---|---|
| On disk | Under the sidecar working directory (dataDir, default ~/.dsh-scrapling): Scrapling's adaptive fingerprint database when adaptiveStorage: sqlite (the default), scrapling_download's output in downloads/, the managed Python and Chromium installed by setup --feature … --apply (runtime/), and the MCP entry written by setup --mode … --apply (mcp/<mode>.patch.yml). With adaptiveStorage: redis the fingerprints are not written under dataDir at all — they go to the Redis at redisUrl, keyed <prefix>:<registrable-domain>:<sha256(identifier)>; that URL defaults to loopback, and pointing it at another machine hands this data to that machine. The crawl queue lands only when crawlCheckpointDir is set (the upstream Collector(crawldir=…) writes it); an empty value writes nothing. Login-state files go under sessionStateDir when it is configured. Screenshots are handed to the host attachment service, which decides where they live. Settings values live in the host settings document |
| Network | Fetches go to the URLs the model supplies, through the configured proxy if any. Search queries go to the single backend searchBackend selects — Tavily (api.tavily.com, key in the request body), Bing (www.bing.com, no key), Brave (api.search.brave.com, X-Subscription-Token), Serper (google.serper.dev, X-API-KEY), DuckDuckGo (html.duckduckgo.com, no key), the SearXNG instance at searxngEndpoint, or DeepSeek's direct Search API at deepseekSearchEndpoint. The first six run in the Python sidecar; DeepSeek runs in Host through optional ctx.deepseekAuth. A backend receives only its own credential plus the query string; keys are never logged. Turning on searchPublicFallback lets auto send queries to a public engine with no credential at all. scrapling_answer sends the fetched page text and the question through the host llm service — that content leaves the machine when the routed model is remote |
| Logs | The chosen interpreter, the probed capabilities, and the proxy summary (scheme://host:port plus which rung answered — never credentials) |
| In memory | Sessions, cookies and recorded network history live in the sidecar process and disappear with it |
| Telemetry | None |
Known boundaries
Registered honestly, one entry per class.
- Rendering can only lose content on pages that ship readable text and then swap it out. Sites that serve text for search engines and no-JS users, then empty those containers into canvas / Lottie animation, come back emptier after rendering — see Render or static.
- Axis ticks inside SVG are unreachable in every tool: the Markdown conversion emits no
<svg>/<text>nodes. For chart values, locate the JSON endpoint withscrapling_capture_xhr. - A browser session's proxy is fixed at
session_open, andproxyBypassdoes not apply per URL inside it (a context switch would discard the cookies and login state that are the point of a session). Static sessions decide per request. headersandretriesonscrapling_session_fetchbelong to static sessions. Upstream silently drops both for browser sessions, so this package refuses them withBAD_ARGSnaming the knob to use instead — a silent no-op is the failure mode it exists to eliminate.- Browser identity knobs only live on the tools that can apply them.
useragent/locale/timezoneId/headlessare model-visible on the one-shot browser tools and onscrapling_session_open— they take effect at session construction, and passing them per request is silently dropped upstream. - Network history is session-level. Recording is a construction-time setting (
recordRequestsdeployment default, orrecordNetworkperscrapling_session_open); a session that is not recording answers an error, not an empty list. scrapling_screenshotbypasses text cleaning. Screenshots capture whatever the page renders in the viewport — including visual secrets (tokens, private messages, data behind a login) that never appear in the DOM text the other tools clean. They are stored through the host attachment service and are only available when that service is mounted. What comes back is the service's normalized reference: a declared PNG can be persisted asimage/jpegat a smaller raster, withoriginalDimensionscarrying what the page actually produced (host contract:saveImagein@deepseek-ai/dsh-attachment).scrapling_downloadwrites bytes underdataDir/downloads, never overwrites an existing file, and refuses path components infilename.scrapling_extract,scrapling_locateandscrapling_linksare offline parsers. All three take HTML from the caller and never fetch;scrapling_linkskeeps relative links only whenbaseUrlis supplied — with an emptybaseUrlit returns no links rather than guessing absolute URLs. All three shareextractMaxOutputChars.- Adaptive relocation is best-effort. Scrapling saves only the first matching element, and a near-identical sibling can be chosen when the original attributes change. Treat a relocated match as a hint and verify it;
scrapling_locatenever saves fingerprints. - TLS trust comes from certifi, not the bare managed interpreter's OpenSSL defaults. The managed CPython has no OpenSSL configuration of its own, so on macOS
ssl.get_default_verify_paths()resolves to the system store/private/etc/ssl/cert.pem, which is missing several public roots — measured onexample.com, whose SSL.com chain fails there (verify error:num=20) and verifies cleanly against certifi's bundle. The bridge therefore pointsSSL_CERT_FILEandCURL_CA_BUNDLEatcertifi.where()only when neither is already set, so a corporate MITM proxy or a private root you pin yourself still wins. The symptom this removes readsFETCH_FAILED ... unable to get local issuer certificateon sites whose chain the system store cannot complete. - Runtime packs are verified on macOS arm64 only. Windows, Linux and macOS x64 report every pack as
blocked; the installer refuses rather than guessing an asset path (B1/B2). - The
adaptive-redispack is a client, not a storage engine. Upstream ships onlySQLiteStorageSystem; the Redis backend here is this plugin'spy/redis_storage.py, aStorageSystemMixinsubclass keyed by registered domain. Enabling it changes where fingerprints live, so treat it as a deployment decision, not a per-call switch. The plugin's own MCP server is separate — it runs in-process and needs no pack. - Shopify crawl mode walks the store's JSON API.
mode=shopifyuses the store's/collections.jsonand each collection's/products.json(upstream'sShopifySpider) and yields one row per variant —name(product + variant, minusDefault Title),price,sku,stock(nullwhen available,0when not),identifier,brand,category,image_url,url,barcode,old_price,description. It never scrapes product HTML, and it obeys the same URL gate, robots setting, delay and concurrency knobs as the other crawl modes. Verified against a local fixture store; a real Shopify store has not been exercised (B11). maxPagescaps the pages collected, not the requests the spider makes. The link discovery layer keeps requesting queued pages (one measuredmaxPages=3crawl issued about 680 requests while collecting 3). Politeness toward the target site is governed by the deployment knobs:crawlRespectRobots,crawlDownloadDelayMs,crawlConcurrentRequests,crawlAutothrottle.- Heavy pages can keep the browser path from ever settling. When resources stay in flight past the default 30-second page timeout,
scrapling_session_fetch/scrapling_renderfail while a static fetch of the same URL succeeds. Mitigations:waitSelector(wait for a key element) ordisableResources(block images and fonts), both per-call parameters the model can pass. official-mcpconnects the upstream server.integrationMode=official-mcpregisters no native tool and starts no server from this plugin; on a host that exposesmcpManager(the rc.2 web bundle) the managedscrapling-mcpis registered dynamically, and where that service is absent (CLI/headless)setup --mode official-mcp --accept-riskproduces thedsh-mcp-cliententry instead. The binary comes from themcppack (B10 is the risk decision that entry stands on).
FAQ
| Question | Answer |
|---|---|
| The model says the render / capture_xhr tools do not exist | No browser engine on this machine — the plugin registers only what works. Run python -m patchright install chromium and restart. If every tool is missing, the sidecar did not start: the startup log names the chosen interpreter, and a missing Scrapling carries the pip line to copy |
| After enabling a proxy, every fetch is blocked | A fake-IP proxy resolves every domain into a non-public range; the gate auto-detects that class and relaxes to the known pools. A self-built pool outside them goes into syntheticDnsRanges. Private and loopback addresses stay blocked on purpose |
web_fetch reports WEB_PROVIDER_CONFIGURED_UNAVAILABLE / _MISSING | The deployment line points at this plugin: either the sidecar is down (interpreter or Scrapling — see the startup log), or the plugin was removed and the fetchProvider / searchProvider line is still there. Remove the line too |
| The model cannot POST a form | allowWriteMethods is off by default and deployment-only — it decides whether the model may change state on a remote host |
web_search reports SEARCH_AUTH | The selected backend has no credential: Tavily/Brave/Serper need their key, SearXNG needs searxngEndpoint. Set it, or switch searchBackend. With searchBackend=auto and no key and no searxngEndpoint, the plugin reports SEARCH_BACKEND_MISSING — set a key / endpoint, or turn on searchPublicFallback to allow public engines |
| The numbers on a chart are missing | SVG tick labels do not survive the Markdown conversion in any tool. Use scrapling_capture_xhr to find the JSON endpoint behind the chart |
Development
pnpm install
pnpm run check # typecheck → lint → client build → host build → tests → format, then the Python chain
pnpm run test:py # end-to-end check of the Python sidecar
- The Python half is gated like the TypeScript half.
checkends withcheck:py: an interpreter report, a face count (the shipped.pyfiles and the test directory must both be there — a missing test directory makes "clean" and "untested" indistinguishable), a dependency consistency check, ruff check, ruff format, mypy, the sidecar end-to-end, bandit (all severities;# noseconly for justified false positives), and a coverage floor measured only over the modules that ship. Dev tools:pip install -r py/requirements-dev.txtinto the interpretertest:pyuses. - The Python 3.14 floor is one fact in four places: both READMEs, the ruff and mypy targets, and a runtime gate in
py/bridge.pythat exits before any Scrapling import with a clean stdout — stdout is protocol frames, so an old interpreter shows the exit code and a stderr line instead of garbage. - mypy checks untyped bodies and rejects unannotated defs and unused ignores. Playwright's
page/route/websocketobjects have no shape until runtime, soignore_missing_importsandANN401stay off; those three checks are on, not the fullstrictprofile. - Sources are TypeScript.
host.jsandclient.jsare build artifacts and deliberately.js: Node refuses to strip types for packages insidenode_modules, which is exactly where dsh loads the plugin from. The artifact is ESM-only;require()will not get you the plugin, and that is deliberate. - Gates that pin the published shape:
test/publish-manifest.test.ts(entry targets covered byfiles, no source file as an entry point,dsh-*pins exact and uniform, no host package body inlined, no dates or bad bytes in comments or documents) andtest/readme-parity.test.ts(the two READMEs name every tool and every settings-card knob, and their section structures match). - Publishing runs through
.github/workflows/publish.yml(manual, OIDC trusted publishing plus--provenance).
Feedback
Issues and pull requests are welcome: https://github.com/JayYuen666/dsh-scrapling/issues.
If a plugin fails to boot, include the dsh host version, the profile install shape, and the browser console line. The missed the module table line is especially useful: it tells us whether the shared client row was materialized.
License
MIT. Source at github.com/JayYuen666/dsh-scrapling. Issues go to that repository's tracker.
This package ships no third-party source code — Scrapling and the browser engines are runtime dependencies. The third-party content in the package is the icon (the official Scrapling mark, BSD 3-Clause) and the zod code inlined into the single-file CLI bundle; the host-side client bundle keeps zod external. THIRD_PARTY_NOTICES.md records that boundary.
Related plugins
archify (deepseek-harness)
tt-a1i/archify
WeKnora (dsh-weknora)
tencent/weknora
next-ai-draw-io (dsh-plugin)
dayuanjiang/next-ai-draw-io
AiToEarn (dsh-plugin-aitoearn)
yikart/aitoearn