firecrawl-interact

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

firecrawl 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. For web searches, use
search
— interact is for acting on a specific page.
在实时浏览器会话中与已抓取的页面进行交互。先抓取页面,然后使用自然语言提示或代码进行点击、填写表单、导航和提取数据。对于网页搜索,请使用
search
——interact用于对特定页面执行操作。

Quick start

快速开始

bash
undefined
bash
undefined

1. Scrape a page (scrape ID is saved automatically)

1. 抓取页面(抓取ID会自动保存)

firecrawl scrape "<url>"
firecrawl scrape "<url>"

2. Interact with the page using a positional prompt

2. 使用位置提示与页面交互

firecrawl interact "Click the login button" firecrawl interact "Fill in the email field with test@example.com" firecrawl interact "Extract the pricing table"
firecrawl interact "Click the login button" firecrawl interact "Fill in the email field with test@example.com" firecrawl interact "Extract the pricing table"

A UUID first argument is auto-detected as the scrape ID

UUID作为第一个参数会被自动识别为抓取ID

firecrawl interact "<scrape-id>" "Extract the pricing table"
firecrawl interact "<scrape-id>" "Extract the pricing table"

3. Or use code for precise control

3. 或使用代码实现精准控制

firecrawl interact --code "agent-browser click @e5" --bash firecrawl interact --code "agent-browser snapshot -i" --bash
firecrawl interact --code "agent-browser click @e5" --bash firecrawl interact --code "agent-browser snapshot -i" --bash

4. Stop the session when done

4. 完成后停止会话

firecrawl interact stop

Run `firecrawl interact --help` for the full option list.

**Done when:** the requested content or action result is captured and the session is stopped with `firecrawl interact stop`.
firecrawl interact stop

运行`firecrawl interact --help`查看完整选项列表。

**完成标志:** 已捕获请求的内容或操作结果,并使用`firecrawl interact stop`停止会话。

Profiles

配置文件(Profiles)

Use
--profile
on the scrape to persist browser state (cookies, localStorage) across scrapes:
bash
undefined
在抓取时使用
--profile
参数可在多次抓取间保留浏览器状态(Cookie、localStorage):
bash
undefined

Session 1: Login and save state

会话1:登录并保存状态

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

会话2:以已认证状态返回

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-changes
firecrawl 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-changes

Tips

提示

  • Always scrape first —
    interact
    requires a scrape ID from a previous
    firecrawl scrape
    call
  • The scrape ID is saved automatically, so you can omit
    --scrape-id
    for subsequent interact calls. Saved sessions may expire after about 10 minutes; re-scrape if the CLI warns that the session is stale
  • Use
    firecrawl interact stop
    to free resources when done
  • For parallel work, scrape multiple pages and interact with each using
    --scrape-id
  • 务必先抓取页面——
    interact
    需要来自之前
    firecrawl scrape
    调用的抓取ID
  • 抓取ID会自动保存,因此后续interact调用可省略
    --scrape-id
    。已保存的会话可能在约10分钟后过期;如果CLI提示会话已失效,请重新抓取
  • 完成后使用
    firecrawl interact stop
    释放资源
  • 如需并行操作,可抓取多个页面并使用
    --scrape-id
    分别与每个页面交互

See also

另请参阅

  • firecrawl-scrape — try scrape first, escalate to interact only when needed
  • firecrawl-search — use
    search
    for web searches
  • firecrawl-agent — AI-powered extraction (less manual control)
  • firecrawl-scrape — 先尝试scrape,仅在必要时升级为interact
  • firecrawl-search — 网页搜索请使用
    search
  • firecrawl-agent — AI驱动的提取(手动控制较少)