firecrawl-crawl 用于从一个网站批量提取内容。它会跟随页面链接进行爬取,并受深度或页数限制约束。
适用场景
- 需要站点上多个页面的内容(例如全部 /docs/ 目录)。
- 希望提取整个站点分区。
- 它是升级工作流中的第 4 步:search → scrape → map → crawl → interact。
快速开始
爬取文档分区:
firecrawl crawl "<url>" --include-paths /docs --limit 50 --wait -o .firecrawl/crawl.json
带深度限制的完整爬取:
firecrawl crawl "<url>" --max-depth 3 --wait --progress -o .firecrawl/crawl.json
检查正在运行的爬取状态:
firecrawl crawl
选项
| 选项 | 说明 |
|---|---|
--wait |
等待爬取完成后再返回 |
--progress |
等待时显示进度 |
--limit <n> |
最多爬取的页面数 |
--max-depth <n> |
跟随链接的最大深度 |
--include-paths <paths> |
仅爬取匹配这些路径的 URL |
--exclude-paths <paths> |
跳过匹配这些路径的 URL |
--delay <ms> |
请求之间的延迟 |
--max-concurrency <n> |
最大并行爬取工作数 |
--pretty |
美化输出 JSON |
-o, --output <path> |
输出文件路径 |
提示
- 需要立即获取结果时,始终使用
--wait。不使用时,爬取会返回一个作业 ID 供异步轮询。 - 使用
--include-paths限定爬取范围——只需要一个分区时,不要爬取整个站点。 - 爬取按页消耗额度。大规模爬取前请检查
firecrawl credit-usage。
另见
- firecrawl-scrape — 抓取单个页面
- firecrawl-map — 在决定爬取前发现 URL
- firecrawl-download — 将站点下载到本地文件(使用 map + scrape)