用途
Firecrawl 技能用于专业网页抓取和数据提取,基于 Firecrawl API 实现。当需要抓取复杂网页、提取结构化数据或批量爬取网站时,可使用此技能。
主要能力
- 单页抓取(支持动态内容)
- 结构化数据提取
- 批量网站爬取
- 搜索并抓取
使用方式
1. 抓取单个网页
./scripts/firecrawl.sh scrape <url> [format]
format 可选:markdown(默认)、html、text、json。
2. 提取结构化数据
./scripts/firecrawl.sh extract <url> <schema>
3. 批量爬取网站
./scripts/firecrawl.sh crawl <url> [max_pages]
4. 搜索并抓取
./scripts/firecrawl.sh search <query> [limit]
API Key
存储在:pass show api/firecrawl
示例
抓取 Polymarket 页面:
./scripts/firecrawl.sh scrape "https://polymarket.com/event/fed-decision-in-march-885"
提取产品信息:
./scripts/firecrawl.sh extract "https://example.com/product" '{"name": "string", "price": "number"}'
搜索 AI 新闻:
./scripts/firecrawl.sh search "latest AI news" 5
适用场景
- 需要抓取包含动态内容的复杂网页
- 需要从网页中提取结构化字段数据
- 需要批量爬取网站多个页面
- 需要先搜索再抓取相关内容
限制
- Firecrawl 有使用限制(取决于套餐)
- 复杂网页可能需要更长的处理时间
- 某些网站可能有反爬虫机制