mcpField
F
firecrawl-interact

firecrawl-interact

github.com/firecrawl数据与数据库25271 次安装6 天前更新
代码仓库

关于 firecrawl-interact

firecrawl-interact 是一项在抓取网页后操作实时浏览器会话的技能,支持用自然语言或代码执行页面操作和数据提取,并可通过配置文件保留浏览器状态。

主要功能

  1. 01点击、填写表单并浏览页面
  2. 02从特定页面提取数据
  3. 03使用自然语言提示词或代码
  4. 04通过配置文件保留浏览器状态

适用场景

  1. 01提交已抓取页面上的表单
  2. 02提取网页中的价格表
  3. 03使用已保存的浏览器状态重新访问网站

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/firecrawl/firecrawl-claude-plugin --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 分别与每个页面交互

另请参阅

评论

支持 Markdown