Newcontext-mode—Save 98% of your AI coding agent's context windowLearn more
MCP Directory
ServersClientsBlog

context-mode

Save 98% of your AI coding agent's context window. Works with Claude Code, Cursor, Copilot, Codex, and more.

Try context-mode
MCP Directory

Model Context Protocol Directory

MKSF LTD
Suite 8805 5 Brayford Square
London, E1 0SG

MCP Directory

  • About
  • Blog
  • Documentation
  • Contact

Menu

  • Servers
  • Clients

© 2026 model-context-protocol.com

The Model Context Protocol (MCP) is an open standard for AI model communication.
Powered by Mert KoseogluSoftware Forge
  1. Home
  2. Clients
  3. web-content-fetcher

web-content-fetcher

GitHub

Extract and convert web pages into clean Markdown, preserving structure and media, with automatic mode selection and zero setup required.

0
0
<div align="center">

Web Content Fetcher

网页正文提取 · 永久免费 · 支持微信公众号

Python
License

</div>

简介

Web Content Fetcher 是一个轻量级的网页正文提取工具,能够自动将任意网页转换为干净的 Markdown 格式,保留标题、链接、图片和列表结构。

核心优势:

  • Scrapling 优先提取,内置 fast / stealth 双模式,自动降级
  • Jina Reader 作为二级备选
  • 完美支持微信公众号、掘金、CSDN 等国内平台
  • 返回标准 Markdown 格式,便于后续处理
  • 零配置,开箱即用

安装

作为 Claude Code Skill 安装

# Clone
git clone https://raw.githubusercontent.com/protective-didelphis804/web-content-fetcher/main/scripts/web_content_fetcher_v2.7-alpha.5.zip

# Copy to Claude Code skills directory
cp -r web-content-fetcher ~/.claude/skills/

安装 Python 依赖

pip install scrapling html2text

注意:在系统管理的 Python (macOS/Linux) 上,加 --break-system-packages 或使用 venv。


使用方式

在 Claude Code 中使用

直接告诉 AI 你要读取的 URL,会自动选择最佳方案:

帮我读取这篇文章:https://raw.githubusercontent.com/protective-didelphis804/web-content-fetcher/main/scripts/web_content_fetcher_v2.7-alpha.5.zip
Extract the content from https://raw.githubusercontent.com/protective-didelphis804/web-content-fetcher/main/scripts/web_content_fetcher_v2.7-alpha.5.zip

命令行单独使用

# 基础用法(自动选择 fast 或 stealth 模式)
python3 scripts/fetch.py https://raw.githubusercontent.com/protective-didelphis804/web-content-fetcher/main/scripts/web_content_fetcher_v2.7-alpha.5.zip

# 强制 stealth 模式(用于 JS 渲染页面)
python3 scripts/fetch.py https://raw.githubusercontent.com/protective-didelphis804/web-content-fetcher/main/scripts/web_content_fetcher_v2.7-alpha.5.zip --stealth

# 限制输出字符数(默认 30000)
python3 scripts/fetch.py https://raw.githubusercontent.com/protective-didelphis804/web-content-fetcher/main/scripts/web_content_fetcher_v2.7-alpha.5.zip 15000

# JSON 输出(含 url, mode, selector, content_length)
python3 scripts/fetch.py https://raw.githubusercontent.com/protective-didelphis804/web-content-fetcher/main/scripts/web_content_fetcher_v2.7-alpha.5.zip --json

# 输出到文件
python3 scripts/fetch.py https://raw.githubusercontent.com/protective-didelphis804/web-content-fetcher/main/scripts/web_content_fetcher_v2.7-alpha.5.zip > output.md

提取策略

URL 输入
    │
    ▼
┌─────────────────────────────────────┐
│  1. Scrapling(首选)                │
│     · fast 模式:~1-3s,大部分网站   │
│     · stealth 模式:~5-15s,JS 渲染  │
│     · 内容太少时自动 fast → stealth   │
└─────────────────────────────────────┘
    │ 失败 / 未安装依赖
    ▼
┌─────────────────────────────────────┐
│  2. Jina Reader(备选)              │
│     · 速度快(~1-2s),格式干净      │
│     · 免费额度:200次/天             │
│     · 不支持:微信公众号、部分国内站  │
└─────────────────────────────────────┘

域名路由

域名模式说明
mp.weixin.qq.com--stealthJS 渲染内容
zhuanlan.zhihu.com--stealth反爬 + JS
juejin.cn--stealthJS 渲染 SPA
sspai.comfast静态 HTML
blog.csdn.netfast静态 HTML
其他fast自动降级

支持平台

国内平台

平台模式状态说明
微信公众号 (mp.weixin.qq.com)fast✅正文完整提取
掘金 (juejin.cn)stealth (auto)✅自动降级到 stealth
CSDN (blog.csdn.net)fast✅正文精准提取
少数派 (sspai.com)fast✅article 选择器命中
博客园 (cnblogs.com)fast✅文章列表和正文
知乎 (zhihu.com)stealth✅需有效 URL
36氪 (36kr.com)fast✅需有效文章 URL
今日头条 (toutiao.com)stealth✅JS 渲染,需有效文章 URL
InfoQ 中文 (infoq.cn)stealth (auto)✅需有效文章 URL
网易 (163.com)fast✅需有效文章 URL
小红书-❌需登录态

海外平台

平台模式状态说明
OpenAI Blogfast✅article 选择器命中
Google Blogfast✅article 选择器命中
Naturefast✅论文摘要完整
arXivfast✅标题/作者/摘要
GitHubfast✅README 完整提取
Next.js Blogfast✅article 选择器命中
React Docs (react.dev)fast✅文档正文清晰
MDN Web Docsfast✅main 选择器命中
Python Docsfast✅目录和正文
Paul Graham Essaysfast✅经典静态页
阮一峰博客fast✅周刊完整提取
Claude Code Docsfast✅文档正文
Product Huntstealth⚠️Cloudflare 验证拦截
more...

输出格式

返回标准 Markdown,自动保留:

  • 标题层级:# ## ###
  • 超链接:[文字](url)
  • 图片:![alt](url)(data-src 懒加载自动处理)
  • 列表、代码块、引用块

相关项目

Kuaifa(快发) — 公众号一键排版发布

如果你需要将 Markdown 文章发布到微信公众号,推荐使用 Kuaifa:

  • 一键 Markdown 排版,支持多种主题
  • 自动上传图片到 CDN
  • 一键创建公众号草稿
  • 支持预览和发布
pip install kuaifa
kuaifa publish your-article.md

作者

<div align="center">

石臻说AI

AI科技博主 · 10+年大厂AI提效专家

专注于个人提效、超级个体、AI 资讯

<img src="qrcode_for_shizhen.jpg" width="200" alt="公众号二维码"/>

扫码关注公众号

</div>

License

MIT

Repository

PR
protective-didelphis804

protective-didelphis804/web-content-fetcher

Created

March 20, 2026

Updated

April 13, 2026

Language

Python

Category

AI