dsh-scrapling: Wiring Scrapling into 4 LLM-Ready Tools

Introduction

DeepSeek Harness (DSH) adopts a plugin-based architecture that opens up capabilities to developers. However, when building agents, two common issues arise: first, there is a lack of model-facing scraping interfaces; second, there is no off-the-shelf integration for embedding mature Python scraping libraries (such as Scrapling) into DSH. The dsh-scrapling plugin bridges this gap by exposing Scrapling’s scraping capabilities as four tools (fetch / extract / batch / site) through a Python bridge process, enabling direct invocation from the model side.

What Is This

dsh-scrapling is a DSH plugin maintained by tietoumiao, categorized as a “Web Tool.” It wraps Scrapling’s capabilities into four model-accessible tools: scrape_fetch, scrape_extract, scrape_batch, and scrape_site. The plugin is released under the MIT license and does not bundle Scrapling’s source code—it interacts with Scrapling solely via subprocess calls.

Core Features

  • scrape_fetch: Fetches a URL and renders it as Markdown / plain text / raw HTML, along with status code, final redirected URL, title, character count, and a truncation flag. Supports GET / POST.
  • scrape_extract: Extracts named fields via CSS/XPath or ::text, or extracts lists/tables as a set of objects in rows mode.
  • scrape_batch: Concurrently fetches up to 50 URLs; a single URL failure does not affect the overall result. Extraction can be applied per URL.
  • scrape_site: Crawl a site using ContentSpider, producing one Markdown entry per page, bounded by max_pages and a total character budget.

Two engine tiers:

  • http (default): Spooofs an HTTP client (curl_cffi fingerprint) without launching a browser. Response time ~2–3.5 seconds.
  • stealth: Real browser (StealthyFetcher) with JavaScript execution, anti-detection, and Cloudflare Turnstile bypass capability. Cold start ~5–10 seconds.

Installation & Setup

Requires a DSH host, Python 3.10+, and Scrapling already installed:

pip install "scrapling[fetchers]"

Place this repository into a plugin directory loadable by DSH, and register the plugin ID in the profile’s dsh.profile.bundles. Configuration example:

- insert:
    - id: dsh-scrapling
      name: dsh-scrapling
      config:
        python: '/path/to/python'          # interpreter with scrapling installed
        root: '/path/to/scrapling-root'    # directory for .sessions / .tmp / browsers
        callTimeoutMs: 120000
        maxChars: 20000

Typical Usage

// Fetch a page's main content
await scrape_fetch({ url: "https://example.com", format: "markdown" })

// List → a set of objects
await scrape_extract({
  url: "https://news.ycombinator.com",
  rows: { container: ".athing", limit: 30, fields: {
    title: { selector: ".titleline a" },
    href:  { selector: ".titleline a", attribute: "href" },
    rank:  { selector: ".rank", regex: "(\\d+)" }
  }}
})

// Bypass Cloudflare
await scrape_fetch({ url: "...", mode: "stealth", options: { solve_cloudflare: true } })

Use Cases & Caveats

Well suited for scenarios that require direct scraping capabilities within an agent, such as news aggregation, information extraction, and site monitoring. The plugin runs with the permissions of the current DSH process; review the source code and license before installation.

In Summary

dsh-scrapling connects Scrapling’s capabilities to the model side through four tools, providing a unified interface from single-page fetching to full-site crawling. See the directory page and the GitHub repository for further details and source code.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye