firecrawl-interact
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesefirecrawl interact
firecrawl interact
Interact with scraped pages in a live browser session. Scrape a page first, then use natural language prompts or code to click, fill forms, navigate, and extract data.
在实时浏览器会话中与已爬取页面交互。首先爬取一个页面,随后即可通过自然语言提示或代码点击、填写表单、导航、提取数据。
When to use
适用场景
- Content requires interaction: clicks, form fills, pagination, login
- failed because content is behind JavaScript interaction
scrape - You need to navigate a multi-step flow
- Last resort in the workflow escalation pattern: search → scrape → map → crawl → interact
- Never use interact for web searches — use instead
search
- 内容需要交互才能访问:点击、表单填写、分页、登录
- 命令执行失败,因为内容需要通过JavaScript交互才能加载
scrape - 需要导航多步流程
- 工作流升级模式的最后手段:搜索 → 爬取 → 映射 → 爬虫 → interact
- 绝对不要使用interact执行网页搜索 —— 请使用命令
search
Quick start
快速开始
bash
undefinedbash
undefined1. Scrape a page (scrape ID is saved automatically)
1. Scrape a page (scrape ID is saved automatically)
firecrawl scrape "<url>"
firecrawl scrape "<url>"
2. Interact with the page using natural language
2. Interact with the page using natural language
firecrawl interact --prompt "Click the login button"
firecrawl interact --prompt "Fill in the email field with test@example.com"
firecrawl interact --prompt "Extract the pricing table"
firecrawl interact --prompt "Click the login button"
firecrawl interact --prompt "Fill in the email field with test@example.com"
firecrawl interact --prompt "Extract the pricing table"
3. Or use code for precise control
3. Or use code for precise control
firecrawl interact --code "agent-browser click @e5" --language bash
firecrawl interact --code "agent-browser snapshot -i" --language bash
firecrawl interact --code "agent-browser click @e5" --language bash
firecrawl interact --code "agent-browser snapshot -i" --language bash
4. Stop the session when done
4. Stop the session when done
firecrawl interact stop
undefinedfirecrawl interact stop
undefinedOptions
可选参数
| Option | Description |
|---|---|
| Natural language instruction (use this OR --code) |
| Code to execute in the browser session |
| Language for code: bash, python, node |
| Execution timeout (default: 30, max: 300) |
| Target a specific scrape (default: last scrape) |
| Output file path |
| Option | Description |
|---|---|
| 自然语言指令(与--code二选一使用) |
| 要在浏览器会话中执行的代码 |
| 代码使用的语言:bash、python、node |
| 执行超时时间(默认:30秒,最大值:300秒) |
| 指定目标爬取任务(默认使用最近一次爬取) |
| 输出文件路径 |
Profiles
配置文件
Use on the scrape to persist browser state (cookies, localStorage) across scrapes:
--profilebash
undefined在爬取时使用参数可在多次爬取之间持久化浏览器状态(Cookie、localStorage):
--profilebash
undefinedSession 1: Login and save state
Session 1: Login and save state
firecrawl scrape "https://app.example.com/login" --profile my-app
firecrawl interact --prompt "Fill in email with user@example.com and click login"
firecrawl scrape "https://app.example.com/login" --profile my-app
firecrawl interact --prompt "Fill in email with user@example.com and click login"
Session 2: Come back authenticated
Session 2: Come back authenticated
firecrawl scrape "https://app.example.com/dashboard" --profile my-app
firecrawl interact --prompt "Extract the dashboard data"
Read-only reconnect (no writes to profile state):
```bash
firecrawl scrape "https://app.example.com" --profile my-app --no-save-changesfirecrawl scrape "https://app.example.com/dashboard" --profile my-app
firecrawl interact --prompt "Extract the dashboard data"
只读重连(不会写入配置文件状态):
```bash
firecrawl scrape "https://app.example.com" --profile my-app --no-save-changesTips
使用提示
- Always scrape first — requires a scrape ID from a previous
interactcallfirecrawl scrape - The scrape ID is saved automatically, so you don't need for subsequent interact calls
--scrape-id - Use to free resources when done
firecrawl interact stop - For parallel work, scrape multiple pages and interact with each using
--scrape-id
- 始终先执行爬取 —— 需要来自之前
interact调用生成的爬取IDfirecrawl scrape - 爬取ID会自动保存,因此后续的interact调用不需要指定
--scrape-id - 使用完毕后执行释放资源
firecrawl interact stop - 如需并行工作,可先爬取多个页面,再通过分别与每个页面交互
--scrape-id
See also
相关参考
- firecrawl-scrape — try scrape first, escalate to interact only when needed
- firecrawl-search — for web searches (never use interact for searching)
- firecrawl-agent — AI-powered extraction (less manual control)
- firecrawl-scrape —— 优先尝试scrape,仅在需要时升级使用interact
- firecrawl-search —— 用于网页搜索(永远不要用interact执行搜索)
- firecrawl-agent —— AI驱动的提取功能(手动控制更少)