关于 firecrawl-interact
firecrawl-interact 是一项命令行技能,可在抓取页面后通过实时浏览器会话操作页面。它支持自然语言或代码交互,并可通过配置文件复用已登录的浏览器状态。
主要功能
- 01点击、填写表单并浏览页面
- 02提取指定页面的数据
- 03通过配置文件复用浏览器状态
- 04操作多个已抓取页面
适用场景
- 01提交登录表单并查看账户页面
- 02提取页面中的定价表
- 03批量操作多个已抓取页面
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ firecrawl/ skills --skill firecrawl-interact安装后在 Claude Code 中输入/firecrawl-interact确认已加载。
详细介绍
firecrawl interact
在实时浏览器会话中与已抓取的页面交互。先抓取页面,然后使用自然语言提示词或代码来点击、填写表单、导航和提取数据。对于网页搜索,请使用 search——interact 用于操作特定页面。
快速开始
# 1. Scrape a page (scrape ID is saved automatically)
firecrawl scrape "<url>"
# 2. Interact with the page using a positional prompt
firecrawl interact "Click the login button"
firecrawl interact "Fill in the email field with [email protected]"
firecrawl interact "Extract the pricing table"
# A UUID first argument is auto-detected as the scrape ID
firecrawl interact "<scrape-id>" "Extract the pricing table"
# 3. Or use code for precise control
firecrawl interact --code "agent-browser click @e5" --bash
firecrawl interact --code "agent-browser snapshot -i" --bash
# 4. Stop the session when done
firecrawl interact stop
运行 firecrawl interact --help 查看完整选项列表。
完成标准: 已捕获所需内容或操作结果,并使用 firecrawl interact stop 停止会话。
配置文件
抓取时使用 --profile,以便在多次抓取间保留浏览器状态(cookies、localStorage):
# Session 1: Login and save state
firecrawl scrape "https://app.example.com/login" --profile my-app
firecrawl interact --prompt "Fill in email with [email protected] and click login"
# Session 2: Come back authenticated
firecrawl scrape "https://app.example.com/dashboard" --profile my-app
firecrawl interact --prompt "Extract the dashboard data"
以只读方式重新连接(不写入配置文件状态):
firecrawl scrape "https://app.example.com" --profile my-app --no-save-changes
提示
- 始终先抓取——
interact需要此前调用firecrawl scrape获得的抓取 ID - 抓取 ID 会自动保存,因此后续调用
interact时可以省略--scrape-id。已保存的会话可能会在约 10 分钟后过期;如果 CLI 提示会话已过期,请重新抓取 - 完成后使用
firecrawl interact stop释放资源 - 如需并行处理,请抓取多个页面,并通过
--scrape-id分别与每个页面交互
另请参阅
- firecrawl-scrape — 先尝试抓取,仅在必要时升级到 interact
- firecrawl-search — 使用
search进行网页搜索 - firecrawl-agent — AI 驱动的提取(手动控制较少)
- firecrawl-build-interact — 将 interact 构建到应用中,而不是在此处运行
评论
支持 Markdown