本页内容
你希望让 AI 抓取网页。下面教你如何在一分钟内做到这一点。
前置条件
- Node.js 18+ —— 用
node --version检查 - Claude Code —— 用
npm install -g @anthropic-ai/claude-code安装
就这些。开始吧。
步骤 1:安装 CrawlForge
步骤 2:获取免费 API key
- 前往 crawlforge.dev/signup
- 创建账户(无需信用卡)
- 复制你的 API key(以
cf_live_开头)
现在你拥有 1,000 个免费 credits 可供使用。
步骤 3:配置 Claude Code
运行配置向导:
按提示输入你的 API key。向导会验证连接并自动配置 Claude Code。
备选方案: 手动设置环境变量:
准备就绪。试试这些示例。
打开 Claude Code,粘贴以下任意一个 prompt:
抓取一个网页(1 credit)
Fetch https://news.ycombinator.com and show me the top 5 stories
Claude 使用 fetch_url 获取页面,然后解析 HTML 以提取报道的标题和链接。
搜索网页(5 credits)
Search the web for "best MCP servers for web scraping 2026" and summarize the top 3 results
Claude 使用 search_web 查询 Google,然后总结每条结果。
提取结构化数据(2 credits)
Extract all product names and prices from https://books.toscrape.com
Claude 使用 scrape_structured 配合 CSS 选择器,将结构化数据整理成一张干净的表格。
深度研究(10 credits)
Research the current state of the MCP ecosystem: key players, adoption stats, and where it is heading
Claude 使用 deep_research 查询多个来源、交叉核对论断,并生成一份带引用的报告。
隐身抓取(5 credits)
Use stealth mode to fetch the pricing page from cloudflare.com
Claude 使用 stealth_mode 配合住宅代理和浏览器指纹轮换,绕过反爬虫保护。
credits 成本一览
| 工具 | Credits | 使用场景 |
|---|---|---|
| fetch_url、extract_text、extract_links | 1 | 基础页面抓取 |
| scrape_structured、extract_content、map_site | 2 | 数据提取 |
| analyze_content | 3 | 情感、主题与实体分析 |
| crawl_deep | 4 | 多页面爬取 |
| search_web、batch_scrape | 5 | 搜索与批量操作 |
| deep_research | 10 | 多来源 AI 研究 |
你的 1,000 个免费 credits 可支持 1,000 次基础抓取、200 次搜索 或 100 次深度研究操作。
后续步骤
- 阅读发布公告,了解完整功能概览
- 浏览 API 参考,查看全部 20 个工具
- 查阅完整 MCP 指南,掌握进阶模式
- 如果你更喜欢图形界面,可配置 Claude Desktop