ClawSkills logoClawSkills

Fastest Browser Use

高性能浏览器自动化,用于重度抓取、多标签管理和精确 DOM 提取。当您需要速度、可靠性或高级

介绍

# Fastest Browser Use

基于 Rust 的浏览器自动化引擎,提供轻量级二进制文件,通过 CDP 直接驱动 Chrome。它针对 token 高效的 DOM 提取、强大的会话管理和速度进行了优化。

![终端演示](https://placehold.co/800x400/1e1e1e/ffffff?text=Terminal+Demo+Coming+Soon)

## 🧪 智能体指南

### 1. 通过人机模拟绕过“机器人检测” 模拟鼠标抖动和随机延迟,以抓取受保护的网站。

```bash fast-browser-use navigate --url "https://protected-site.com" \ --human-emulation \ --wait-for-selector "#content" ```

### 2. “深度冻结”快照 捕获整个 DOM 状态 *和* 计算样式,以便稍后完美重建。

```bash fast-browser-use snapshot --include-styles --output state.json ```

### 3. 登录与 Cookie 劫持 手动登录一次,然后窃取会话以进行无头自动化。

**步骤 1:以非无头模式打开进行手动登录** ```bash fast-browser-use login --url "https://github.com/login" --save-session ./auth.json ```

**步骤 2:稍后重用会话** ```bash fast-browser-use navigate --url "https://github.com/dashboard" --load-session ./auth.json ```

### 4. 🚜 无限滚动收割机 **从无限滚动页面中提取新数据** —— 非常适合采集最新的帖子、新闻或社交媒体动态。

```bash # Harvest headlines from Hacker News (scrolls 3x, waits 800ms between) fast-browser-use harvest \ --url "https://news.ycombinator.com" \ --selector ".titleline a" \ --scrolls 3 \ --delay 800 \ --output headlines.json ```

**实际输出**(约 6 秒内 59 个唯一项目): ```json [ "Genode OS is a tool kit for building highly secure special-purpose OS", "Mobile carriers can get your GPS location", "Students using \"humanizer\" programs to beat accusations of cheating with AI", "Finland to end \"uncontrolled human experiment\" with ban on youth social media", ... ] ```

适用于任何无限滚动页面:Reddit、Twitter、LinkedIn 动态、搜索结果等。

### 5. 📸 快速截图 将任何页面捕获为 PNG:

```bash fast-browser-use screenshot \ --url "https://example.com" \ --output page.png \ --full-page # Optional: capture entire scrollable page ```

### 6. 🗺️ 站点地图与页面结构分析器 通过解析站点地图和分析页面结构来发现网站的组织方式。

```bash # Basic sitemap discovery (checks robots.txt + common sitemap URLs) fast-browser-use sitemap --url "https://example.com" ```

```bash # Full analysis with page structure (headings, nav, sections) fast-browser-use sitemap \ --url "https://example.com" \ --analyze-structure \ --max-pages 10 \ --max-sitemaps 5 \ --output site-structure.json ```

**选项:** - `--analyze-structure`:同时提取页面结构(标题、导航、区块、元数据) - `--max-pages N`:将结构分析限制为 N 个页面(默认:5) - `--max-sitemaps N`:将站点地图解析限制为 N 个站点地图(默认:10,适用于大型网站)

**示例输出:** ```json { "base_url": "https://example.com", "robots_txt": "User-agent: *\nSitemap: https://example.com/sitemap.xml", "sitemaps": ["https://example.com/sitemap.xml"], "pages": [ "https://example.com/about", "https://example.com/products", "https://example.com/contact" ], "page_structures": [ { "url": "https://example.com", "title": "Example - Home", "headings": [ {"level": 1, "text": "Welcome to Example"}, {"level": 2, "text": "Our Services"} ], "nav_links": [ {"text": "About", "href": "/about"}, {"text": "Products", "href": "/products"} ], "sections": [ {"tag": "main", "id": "content", "role": "main"}, {"tag": "footer", "id": "footer", "role": null} ], "main_content": {"tag": "main", "id": "content", "word_count": 450}, "meta": { "description": "Example company homepage", "canonical": "https://example.com/" } } ] } ```

在抓取前使用此功能了解网站架构、映射导航流程或审计 SEO 结构。

## ⚡ 性能对比

| 特性 | 快速浏览器使用 (Rust) | Puppeteer (Node) | Selenium (Java) | | :--- | :--- | :--- | :--- | | **启动时间** | **< 50ms** | ~800ms | ~2500ms | | **内存占用** | **15 MB** | 100 MB+ | 200 MB+ | | **DOM 提取** | **Zero-Copy** | JSON 序列化 | 慢速桥接 |

## 功能与工具

### 视觉与提取 - **vision_map**:返回带有交互元素编号边界框的屏幕截图叠加层。 - **snapshot**:捕获原始 HTML 快照(针对 AI 优化的 YAML/Markdown)。 - **screenshot**:捕获页面的可视化图像。 - **extract**:从 DOM 获取结构化数据。 - **markdown**:将当前页面内容转换为 Markdown。 - **sitemap**:通过 robots.txt、站点地图和页面语义分析分析网站结构。

### 导航与生命周期 - **navigate**:访问特定的 URL。 - **go_back** / **go_forward**:遍历浏览器历史记录。 - **wait**:暂停执行或等待特定条件。 - **new_tab**:打开新的浏览器标签页。 - **switch_tab**:将焦点切换到特定标签页。 - **close_tab**:关闭当前或指定的标签页。 - **tab_list**:列出所有打开的标签页。 - **close**:终止浏览器会话。

### 交互 - **click**:通过 CSS 选择器或 DOM 索引点击元素。 - **input**:在字段中输入文本。 - **press_key**:发送特定的键盘事件。 - **hover**:悬停在元素上。 - **scroll**:滚动视口。 - **select**:在下拉菜单中选择选项。

### 状态与调试 - **cookies**:管理会话 cookies(获取/设置)。 - **local_storage**:管理本地存储数据。 - **debug**:访问控制台日志和调试信息。

## 使用方法

此技能专用于需要保持状态(如已登录)、处理动态 JavaScript 内容或同时管理多个页面的复杂 Web 交互。与基于标准 fetch 的工具相比,它提供了更高的性能和控制力。

更多产品