npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ultimate-scraper

v1.0.0

Published

One-command free web scraping toolkit for Claude Code — crawl4ai + trafilatura + one-search MCP + crw MCP + more

Readme

🕷️ Ultimate Scraper Toolkit(终极爬虫工具包)

一条命令,让你的 Claude Code 拥有全网最强免费爬虫能力。

npx ultimate-scraper install

English Docs


这是什么?

一条命令安装 2026 年最强的免费网页爬虫工具矩阵。装完后,你的 Claude Code 可以直接搜索网络、抓取网页(静态/动态都行)、提取文章正文、把 PDF 转成 Markdown、全站爬取——全部免费,零 API Key,零注册。

装了什么?

| 工具 | 类型 | 能干什么 | 致谢上游 | |------|------|----------|----------| | crawl4ai | Python | LLM 友好爬虫(异步、隐身模式、JS 渲染) | unclecode/crawl4ai | | trafilatura | Python | 网页正文精确提取 | adbar/trafilatura | | newspaper4k | Python | 新闻文章解析(标题/作者/日期) | AndyTheFactory/newspaper4k | | markitdown | Python | PDF/Word/PPT/Excel → Markdown | microsoft/markitdown | | httpx | Python | 现代异步 HTTP 客户端 | encode/httpx | | crw | Python | fastCRW Python SDK | us/crw | | one-search | MCP | DuckDuckGo 免费搜索(不限量、无需 Key) | yokingma/one-search-mcp | | crw | MCP | fastCRW 爬虫(兼容 Firecrawl API) | us/crw |

同时自动修改 ~/.claude/settings.json,MCP Server 在每次打开 Claude Code 时自动加载。零手动配置。


前提条件

  • Python 3.10+下载
  • Node.js 18+下载
  • Claude Code — MCP 功能需要(Python 库可独立使用)
python --version   # 应该显示 3.10 或更高
node --version     # 应该显示 v18 或更高

三步上手

第一步:安装

npx ultimate-scraper install

脚本会自动:

  1. 检查 Python + Node.js 环境
  2. pip install 6 个爬虫库(国内自动走清华镜像)
  3. npm install -g MCP Server(自动检测 Windows/macOS/Linux + arm64/x64)
  4. 下载 nltk 分词数据
  5. 把 MCP 配置注入 ~/.claude/settings.json
  6. 运行验证

第二步:验证

npx ultimate-scraper verify

看到 10/10 通过 就对了。

第三步:重启 Claude Code

关掉重开。MCP Server 自动加载。


怎么用

在 Claude Code 里(重启后)

直接用自然语言。MCP Server 在后台自动响应:

"帮我搜索 LangGraph 最新教程" → OneSearch MCP 自动用 DuckDuckGo 搜索

"把 https://example.com 内容抓下来" → crw MCP 返回干净 Markdown

"打开 https://app.example.com 截图" → Playwright MCP 打开浏览器、渲染 JS、截图

在 Python 脚本里

# ── 快速单页抓取 ──
import trafilatura
html = trafilatura.fetch_url("https://example.com")
text = trafilatura.extract(html)
print(text)


# ── 新闻文章(含元数据)──
from newspaper import Article
article = Article("https://example.com/news")
article.download(); article.parse()
print(article.title, article.authors, article.publish_date)


# ── LLM 友好爬虫(JS 渲染页)──
import asyncio
from crawl4ai import AsyncWebCrawler
async def main():
    async with AsyncWebCrawler() as crawler:
        result = await crawler.arun("https://example.com")
        print(result.markdown)
asyncio.run(main())


# ── 任意文档转 Markdown ──
from markitdown import MarkItDown
md = MarkItDown()
result = md.convert("report.pdf")
print(result.text_content)

工具选择策略

基于真实基准测试数据,不是拍脑袋。我们对 6 个不同类型的目标进行了策略化测试(精确匹配,不盲目遍历)。实测结果:

| 目标 | 类型 | 选用工具 | 结果 | 耗时 | 说明 | |------|------|----------|------|------|------| | react.dev/learn | 文档 | trafilatura | ✅ | 2.0s | 干净 Markdown,11K 字符 | | pypi.org/project/trafilatura | 文档 | trafilatura | ✅ | 1.8s | 完整项目描述,7.7K 字符 | | zhihu.com/explore | 中文站 | trafilatura | ✅ | 1.8s | 中文正文正确提取 | | wikipedia.org | 通用 | trafilatura → Jina | ❌ | 15s | GFW 限速 | | github.com/trending | 代码 | trafilatura → Jina | ❌ | 15s | GFW 限速 | | bbc.com/news | 新闻 | newspaper4k | ❌ | 25s | GFW 限速 |

关键发现: 可访问站点 100% 命中。境外被墙站需要优先用 Jina Reader(服务器在境外,绕过 GFW)。这个发现已写入下方策略的第 6 条和第 8 条。

给人用 — CLI 路由:

npx ultimate-scraper strategy "https://example.com/article"

给 AI Agent 用 — 把下面这段贴到 Agent 的系统提示词或 Claude Code 的 .claude/CLAUDE.md 里:

## 网页抓取策略

当需要读取网页内容时,按照以下决策树选择工具。
只选一个工具——不要盲目遍历所有工具。

1. 输入是搜索查询(不是 URL)?
   → 用 OneSearch MCP (DuckDuckGo)。直接说:"搜索 [query]"

2. URL 是文档文件(.pdf, .docx, .xlsx, .pptx)?
   → 用 markitdown。命令:python -c "from markitdown import MarkItDown; print(MarkItDown().convert('URL').text_content)"

3. URL 来自社交平台(reddit.com, x.com, xiaohongshu.com, bilibili.com, youtube.com, linkedin.com, v2ex.com)?
   → 用 agent-reach(平台专用 API,可登录、可翻页)

4. URL 来自技术文档站(docs.*, readthedocs.io, pypi.org, developer.mozilla.org)?
   → 用 Context7 MCP(如有),否则用 trafilatura。命令:python -c "import trafilatura; h=trafilatura.fetch_url('URL'); print(trafilatura.extract(h))"

5. URL 看起来像新闻文章?(含 /2024/01/, /article/, /story/, /news/ 路径,或 bbc.com, reuters.com, techcrunch.com 等域名)
   → 用 newspaper4k。命令:python -c "from newspaper import Article; a=Article('URL'); a.download(); a.parse(); print(a.title, a.authors, a.text)"

6. URL 像是 JS 渲染的 SPA?(vercel.app, netlify.app 域名,或 /app, /dashboard, /login 路径)
   → 首选 Jina Reader:curl -s "https://r.jina.ai/URL" --max-time 15
   → 需要点击、填表、登录时:用 Playwright MCP

7. URL 来自 GitHub?
   → 用 gh CLI 获取结构化数据。页面内容用 trafilatura。

8. 默认(通用网页):
   → 首选:Jina Reader(最快,服务端渲染,JS 页面也通吃)
   → 回退:trafilatura (python -c "import trafilatura; h=trafilatura.fetch_url('URL'); print(trafilatura.extract(h))")

中国用户提示:Wikipedia、BBC、GitHub 等境外站可能被限速。优先用 Jina Reader——它的服务器在境外,不受 GFW 影响。

为什么需要策略: 没有策略的话,Agent 会用每个工具去试每个 URL——浪费时间、被限流、输出垃圾。有这个策略后,Agent 一次就选对工具,和人类专家一样高效。

决策树(可视化参考)

| 我想... | 用这个 | |---------|--------| | 静态网页 → Markdown | curl r.jina.ai/URL(最快) | | JS 渲染的动态页面 | Playwright MCP 或 crawl4ai | | 全站爬取 | crw MCP 或 crawl4ai | | 提取文章正文 | trafilatura | | 解析新闻(含作者/日期) | newspaper4k | | PDF/Word/Excel → Markdown | markitdown | | 免费搜索(无需 API Key) | OneSearch MCP | | 技术文档检索 | Context7 MCP | | 登录后抓取 | Playwright MCP | | 社交媒体数据 | agent-reach(小红书/Twitter/Reddit 等) | | GitHub 代码搜索 | gh search(Claude Code 内置) |


常见问题

真的免费吗? 是的。所有工具都是开源且免费的。不需要 API Key,不需要信用卡,没有调用次数限制。

会拖慢电脑吗? 不会。MCP Server 空闲时合计只占 ~50MB 内存。Python 库只有调用时才消耗资源。

已经装过部分工具? 可以安全地重复运行。安装脚本用 --upgrade,已最新就跳过。

只想装 Python 库,不要 MCP?

pip install crawl4ai trafilatura newspaper4k markitdown httpx crw

会收集我的数据吗? 不会。所有工具在本地运行。MCP Server 直接和目标网站通信,不经过任何第三方。

怎么更新?

npx ultimate-scraper install    # 重新运行即升级

卸载

npx ultimate-scraper uninstall

删除 Python 库(保留 markitdown 和 httpx)、npm 包、nltk 数据。Claude Code 配置不动。


致谢

本工具包基于以下优秀开源项目构建:

  • unclecode — Crawl4AI 作者,开源 LLM 爬虫之王(⭐57K)
  • adbar — trafilatura 作者,网页正文提取的黄金标准
  • AndyTheFactory — newspaper4k 维护者
  • Microsoft — markitdown,通用文档转换器
  • us/crw — fastCRW,Rust 编写的 Firecrawl 替代品
  • yokingma — OneSearch MCP,为 AI Agent 提供免费搜索
  • Jina AI — Jina Reader,零代码 URL 转 Markdown
  • LangChain — LangGraph,Agent 编排框架
  • Mendable — Firecrawl,LLM 友好爬虫的先驱
  • Anthropic — Claude Code 和 MCP 协议

如果你觉得这些工具好用,请去给他们点 Star,有余力可以赞助维护者。


许可

MIT — 随便用,别干坏事。

请遵守目标网站的 robots.txt 和服务条款。