
certainlyscraped
io.github.vhsgreed由 GitHub 帳號 vhsgreed 發布v0.4.5更新於 Nov 1, 2026
Hybrid scraper with escalating effort: cheapest fetch first, reports why each page stopped.
概覽
本機 MCP 擷取工具:探測頁面、產生 YAML 設定、測試選擇器,並把列表頁擷取成結構化資料列,只在受阻時逐級提高擷取方式。
- 可以做什麼
- 探測網址的擷取層級、封鎖標記與內嵌 JSON
- 產生初始 YAML 設定並顯示各欄位的填滿率
- 測試 CSS 選擇器(可限定在容器內),回傳符合數量與範例值
- 以內嵌設定執行擷取,回傳狀態、資料列、實際列數、資料集路徑與逐頁結果
- 適用情境
- 適合需要把公開列表頁轉成結構化資料,並想了解某頁為何失敗、而不是只拿到空結果的情況。也適合探索選擇器與少量、限速的公開頁面擷取。
- 執行需求
- 以本機 stdio 程序執行,從 PyPI 以 uvx 或 pip(mcp 附加套件)安裝,並以 mcp 子指令啟動。需要 Python 執行環境;第 3 層需要選用的重型瀏覽器元件。不需帳號或 API 金鑰。代理為選用,且只能來自伺服器端的代理檔案。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 certainlyscraped,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
certainlyscraped
A hybrid scraper with escalating effort.
It starts with the cheapest fetch that works, escalates only when a page is blocked or still failing, and reports exactly what it got and why it stopped. It reads the page, writes a config for you, checks that every field filled, and turns a listing into rows instead of a promise.
Quickstart: 20 seconds
init probes the site, finds the block that repeats on the page, guesses the
fields and the next-page link, and prints how many items each field filled.
run fetches the pages, writes out.csv, and fails loudly if it gets fewer
rows than --min-rows (default 1) instead of reporting success.
For an agent, add the MCP server to your client. With uv there is nothing to install first:
Without uv, pip install "certainlyscraped[mcp]" and use "command": "certainlyscraped", "args": ["mcp"].
That gives the agent probe, init, try_selector and scrape; the full
contract is under MCP server (for agents).
[certainlyscraped demo: init, try, run]
Real output from the daily live check:
The config is plain YAML you can read and edit:
The escalation ladder
Every page starts at the probed tier (or the config's tier) and climbs only
when that rung fails.
Every group switch also prints [ladder] <host>: <reason>, trying another proxy group, so a rotation is visible while it happens.
Once a site escalates on a challenge or a 403, later pages on that site start
at the new level. A level reached only by an error climb is not remembered.
steps in the page report shows the rungs and the leased group, for example
["t1@dc-a", "t1@dc-b", "t2@dc-b"] (a 403 from one group, a challenge from the
other, real HTML at tier 2).
Tiers
tier: auto probes first and picks the lowest tier that returns a real page.
With a proxy pool configured, auto skips the probe and starts at tier 1: a
probe is a direct request, and with a pool no request may leave from the origin
IP. The ladder climbs from there. A tier is not a promise: it is where the
ladder starts.
Outcomes and exit codes
One record per page, available with --report report.jsonl and in the MCP
response's pages field:
outcome is one of ok, empty, blocked, rate_limited, not_found,
error. A run also prints one summary line:
A page with no response has no HTTP status to quote, so it reads
[done] 1 page: 1 error (no response on /list).
Exit 1 for a page-level failure is reachable only when --min-rows 0 asks for
no rows. At the default --min-rows 1, a run that lost every page to errors
fails the row check first and exits 2.
Exit 4 is narrow on purpose. A trailing not_found or empty page past the
end of a range does not count, and neither does a page that succeeded on retry.
--accept-partial maps 4 to 0 for scripts that only check for zero. A run that
loses one page still writes the rows it did get, and the report says which page
is missing.
MCP server (for agents)
Client configuration:
Four tools, each a thin call into the same API:
config is inline YAML or JSON text, never a path. Config keys proxy,
proxies, cookies, since, snapshot and fetcher are refused, and so are
unknown keys such as json and headers (embedded JSON goes under
items.json). status says what the run
got: complete (at least min_rows rows and no incomplete page), incomplete
(enough rows, but a page ended blocked, rate-limited or errored),
too_few_rows (fewer than min_rows rows), blocked (zero rows and every
page was walled or rate-limited) and error (zero rows and every page
errored). These are not the CLI's exit codes: a blocked-only run exits 2,
exit 3 is only probe --fail-blocked, and exit 1 is a config, I/O or fetch
exception (or, with --min-rows 0, an all-error run). A bad request is still a
status dict: a tool never raises into the JSON-RPC channel.
Private addresses are refused by default: loopback, RFC 1918, link-local
(including 169.254.169.254) and unique-local IPv6, checked after DNS
resolution and on every redirect hop. --allow-private turns that off for
local development. The CLI does not refuse private addresses; only the MCP
server does. A refusal is terminal for the page: one attempt, no retry, no
climb, outcome error with the refusal in the note.
Proxies come only from the server's own --proxies proxies.yaml, never from a
tool argument, and the server never reads CERTAINLYSCRAPED_PROXIES. probe,
init and try_selector lease one proxy from that pool for the call; if the
pool has nothing free they return blocked with no proxy available for <host> and make no request. Without --proxies the server has no pool and
fetches directly. File reads and datasets stay inside the working directory.
Proxies
One proxy still works and becomes a pool of one:
A pool names groups so a 403 or a 429 can try a different network before paying for a heavier tier:
proxies.txt:
Groups are the label after #, else a neutral label net-1, net-2, ... in
order of first appearance, one per IPv4 /16, IPv6 /48 or hostname. A label
never contains a proxy address or hostname.
A proxy that is walled for one host is parked for that host for
cooldown_sec; it is not removed from the pool. session: rotate generates a
new token per lease: one per page, and a 403 or 429 that switches group leases
again. sticky keeps one token per host and worker.
Passwords never belong in the main config. Put them in a dedicated proxies
file passed with --proxies, or in the environment through password_env.
A password inside an inline proxy:/proxies: URL in the committed YAML is
refused with a message naming both alternatives. Page outcomes and MCP
responses carry the group label, never the proxy URL or password. A page that
failed on a dead proxy keeps the transport error as its note, for example
ConnectionError: Failed to perform, curl: (7) Failed to connect to books.toscrape.com:443 over proxy *** ... (the target is kept, the proxy
address is ***); an unresolvable host reads
DNSError: ... Could not resolve host: no-such-host.invalid .... No log line
quotes a proxy address, so the group label and the error text are the
diagnosis. A private address refused by the MCP guard is terminal: one
attempt, no retry, no climb.
Precedence for run: --no-proxy > --proxies FILE >
CERTAINLYSCRAPED_PROXIES > the config. --no-proxy ignores every configured
proxy and fetches directly. MCP has no such flag, never reads
CERTAINLYSCRAPED_PROXIES, and without --proxies has no pool at all.
Speed comes from many hosts or a proxy pool, not from threads alone. The ladder
paces per (host, proxy) at per_proxy_rate_sec (it falls back to
rate_limit_sec; default 1.0).
With no pool, one host gets at most one request per interval no matter the
concurrency, so a single-host pages: job is still paced by the site. With a
pool, N proxies to one host give N slots: eight pages at 1.0 s on one host took
7.1 s with one proxy and 1.1 s with four, in one derived net-1 group or four
labelled groups alike.
Parallel pages
Or an explicit list:
Rows are emitted in page order regardless of which response arrived first.
A pages: range stops after any two consecutive not_found or empty pages,
not only at the end of the range: a gap in the middle ends the run early. Those
pages are not incomplete, so the run can still exit 0.
More commands
try also flags pages rendered by JavaScript, points at embedded JSON, and
warns about brittle DevTools "Copy selector" paths. docs/selectors.md
is the full guide.
What it will not do
- Log in, get past login walls, or use credentials that are not yours.
- Promise that a site works today because it worked on another day.
- Beat fingerprint or JavaScript challenges (Cloudflare managed challenge,
PerimeterX, DataDome) with proxies. Those pages report
blocked; a proxy you bring gets past IP bans, IP-range bans and rate limits, not a challenge. - Ship scraped data. It ships the tool.
What it reaches
COVERAGE.md is a table of 40 popular data targets, probed
nightly and published with a date: which returned rows, which returned a
JavaScript shell, which returned a repeated block that is not the data
(tracking JSON, a cookie dialog, a priceless carousel on a shop), and which
were walled. Each row lists the fields it found, so you can judge the verdict
yourself. It is generated from
targets/popular.yaml and it updates itself, so a
site that starts refusing traffic shows up there instead of staying a claim in
this file. A site behind a login is walled here by definition: tiers 1 to 3 do
not have your password, and do not ask for it.
Why trust the numbers
Every run records one outcome per page, and the daily live check scrapes the same example sites asserted at exit 0, so a quiet regression shows up as a red check rather than a friendly empty CSV.
The old name
The scrapeforge command still works until 0.5.0 and prints one deprecation
notice on stderr; import scrapeforge also works and raises a
DeprecationWarning, which Python shows when the import runs in __main__
(the usual script case) and hides inside imported modules. New code should use
certainlyscraped or cscrape; the old name is removed in 0.5.0.
Development
Tests run offline against saved pages in tests/fixtures/. CI runs them on
Python 3.11 to 3.14. The live check runs the examples against real sites daily.
MIT licensed. Part of the vhsgreed toolset.
來源:README.md,提交 ffba1a4
工具
0版本歷史
1- v0.4.5最新Nov 1, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分