tavily-crawl
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesetavily crawl
tavily crawl
Crawl a website and extract content from multiple pages. Supports saving each page as a local markdown file.
爬取网站并提取多页面内容,支持将每个页面保存为本地Markdown文件。
Prerequisites
前置条件
Requires the Tavily CLI. See tavily-cli for install and auth setup.
Quick install:
curl -fsSL https://cli.tavily.com/install.sh | bash && tvly login需要安装Tavily CLI。请查看 tavily-cli 获取安装与身份验证设置指南。
快速安装命令:
curl -fsSL https://cli.tavily.com/install.sh | bash && tvly loginWhen to use
适用场景
- You need content from many pages on a site (e.g., all )
/docs/ - You want to download documentation for offline use
- Step 4 in the workflow: search → extract → map → crawl → research
- 需要获取某网站多个页面的内容(例如所有路径下的页面)
/docs/ - 想要下载文档以供离线使用
- 工作流的第4步(参考 workflow):搜索 → 提取 → 映射 → 爬取 → 调研
Quick start
快速开始
bash
undefinedbash
undefinedBasic crawl
基础爬取
tvly crawl "https://docs.example.com" --json
tvly crawl "https://docs.example.com" --json
Save each page as a markdown file
将每个页面保存为Markdown文件
tvly crawl "https://docs.example.com" --output-dir ./docs/
tvly crawl "https://docs.example.com" --output-dir ./docs/
Deeper crawl with limits
带限制的深度爬取
tvly crawl "https://docs.example.com" --max-depth 2 --limit 50 --json
tvly crawl "https://docs.example.com" --max-depth 2 --limit 50 --json
Filter to specific paths
过滤特定路径
tvly crawl "https://example.com" --select-paths "/api/.,/guides/." --exclude-paths "/blog/.*" --json
tvly crawl "https://example.com" --select-paths "/api/.,/guides/." --exclude-paths "/blog/.*" --json
Semantic focus (returns relevant chunks, not full pages)
语义聚焦(仅返回相关内容块,而非完整页面)
tvly crawl "https://docs.example.com" --instructions "Find authentication docs" --chunks-per-source 3 --json
undefinedtvly crawl "https://docs.example.com" --instructions "Find authentication docs" --chunks-per-source 3 --json
undefinedOptions
参数选项
| Option | Description |
|---|---|
| Levels deep (1-5, default: 1) |
| Links per page (default: 20) |
| Total pages cap (default: 50) |
| Natural language guidance for semantic focus |
| Chunks per page (1-5, requires |
| |
| |
| Comma-separated regex patterns to include |
| Comma-separated regex patterns to exclude |
| Comma-separated regex for domains to include |
| Comma-separated regex for domains to exclude |
| Include external links (default: allow) |
| Include images |
| Max wait (10-150 seconds) |
| Save JSON output to file |
| Save each page as a .md file in directory |
| Structured JSON output |
| 参数 | 说明 |
|---|---|
| 爬取深度层级(范围1-5,默认值:1) |
| 每页爬取的链接数量(默认值:20) |
| 爬取页面总数上限(默认值:50) |
| 用于语义聚焦的自然语言指导指令 |
| 每个页面提取的内容块数量(范围1-5,需配合 |
| 提取深度,可选 |
| 输出格式,可选 |
| 逗号分隔的正则表达式,用于指定需包含的路径 |
| 逗号分隔的正则表达式,用于指定需排除的路径 |
| 逗号分隔的正则表达式,用于指定需包含的域名 |
| 逗号分隔的正则表达式,用于指定需排除的域名 |
| 是否包含外部链接(默认:允许) |
| 是否包含图片 |
| 最大等待时间(范围10-150秒) |
| 将JSON输出保存至文件 |
| 将每个页面保存为.md文件至指定目录 |
| 输出结构化JSON格式内容 |
Crawl for context vs. data collection
用于上下文补充与数据收集的爬取差异
For agentic use (feeding results to an LLM):
Always use + . Returns only relevant chunks instead of full pages — prevents context explosion.
--instructions--chunks-per-sourcebash
tvly crawl "https://docs.example.com" --instructions "API authentication" --chunks-per-source 3 --jsonFor data collection (saving to files):
Use without to get full pages as markdown files.
--output-dir--chunks-per-sourcebash
tvly crawl "https://docs.example.com" --max-depth 2 --output-dir ./docs/智能代理场景使用(将结果输入LLM):
请始终配合使用 + 。仅返回相关内容块而非完整页面,可避免上下文过载。
--instructions--chunks-per-sourcebash
tvly crawl "https://docs.example.com" --instructions "API authentication" --chunks-per-source 3 --json数据收集场景使用(保存至文件):
使用且不添加,即可获取完整页面的Markdown文件。
--output-dir--chunks-per-sourcebash
tvly crawl "https://docs.example.com" --max-depth 2 --output-dir ./docs/Tips
使用技巧
- Start conservative — ,
--max-depth 1— and scale up.--limit 20 - Use to focus on the section you need.
--select-paths - Use map first to understand site structure before a full crawl.
- Always set to prevent runaway crawls.
--limit
- 保守起步 —— 先设置、
--max-depth 1,再逐步扩大范围。--limit 20 - 使用聚焦到你需要的板块。
--select-paths - 先使用map功能 了解网站结构,再进行完整爬取。
- 务必设置防止爬取过程失控。
--limit
See also
另请参阅
- tavily-map — discover URLs before deciding to crawl
- tavily-extract — extract individual pages
- tavily-search — find pages when you don't have a URL
- tavily-map —— 在决定爬取前先发现目标URL
- tavily-extract —— 提取单个页面的内容
- tavily-search —— 当你没有具体URL时查找目标页面