微算力 · API 导航与自营网关
API 接入 EN
未登录登录
🌐

自然语言驱动的 AI 浏览器自动化

Nova Act Browser Automation · v1.6.0
效率 安全 B 级 作者 zouchaoqun 公开目录收录
1k 下载 2 安装 4.7k 收藏 13 浏览

简介

Amazon Nova Act 驱动的 AI 浏览器自动化工具,支持自然语言控制网页操作、数据抓取与表单填写,需配置 API 密钥使用。

原始描述

Write and execute Python scripts using Amazon Nova Act for AI-powered browser automation tasks like flight searches, data extraction, and form filling.

通过你的 Agent 添加

安装目录:nova-act/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/nova-act-browser-automation/
Codex CLI~/.codex/skills/nova-act-browser-automation/
DeepSeek Harness~/.agents/skills/nova-act-browser-automation/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心功能

Nova Act 是 Amazon 推出的 AI 驱动浏览器自动化 SDK,允许用户通过自然语言指令控制 Chrome 浏览器完成复杂网页任务。该技能封装了 Nova Act 的核心能力,提供开箱即用的脚本运行器和自定义脚本编写支持。

核心用法

快速启动模式:使用捆绑脚本 nova_act_runner.py 执行单页任务,支持传入 URL 和自然语言指令:

subprocess.run(["uv", "run", script, "--url", url, "--task", task])

自定义脚本模式:针对复杂多步骤工作流,编写符合 PEP 723 规范的 Python 脚本,声明 nova-act 依赖后通过 uv run 执行。

API 双模式设计

  • act(prompt):执行点击、输入、滚动等浏览器操作,支持多步骤组合以保持上下文连贯性
  • act_get(prompt, schema):结构化数据提取,支持 Pydantic 模型或 Python 原生类型(list[str], dict, float 等)

显著优点

  1. 自然语言交互:无需学习 XPath 或 CSS 选择器,用人类语言描述操作即可
  2. 结构化输出:通过 schema 参数强制类型安全的数据返回,替代脆弱的正则解析
  3. Amazon 背书:底层由 Amazon Bedrock 驱动的 Nova 模型提供视觉理解能力
  4. Playwright 集成:保留底层浏览器控制能力,高级用户可访问 nova.page 进行原生操作

局限性与风险

安全限制:技能内置多层防护,对涉及资金交易、账号创建、公开发布、邮件发送等「实质性影响操作」强制要求人工确认。AI 代理必须导航至最终步骤后停止,通过 act_get() 观察状态并报告,不得自动完成关键点击。

隐私风险:自动生成 trace 文件包含访问页面的完整截图和 HTML 内容,可能捕获敏感个人信息(PII)。用户需主动审查并清理工作目录中的痕迹文件。

环境依赖:需要本地 Chrome 浏览器或 headless 环境,显示服务不可用时需显式配置 headless=True。

成本考量:Amazon Nova Act API 按调用计费,高频自动化场景需评估 Token 消耗成本。

适合人群

  • 需要快速原型验证浏览器自动化流程的开发者
  • 非技术用户希望用自然语言替代传统爬虫编写
  • 需要结构化数据提取但不愿维护复杂解析规则的数据分析师
  • 已在 AWS 生态中使用 Amazon Bedrock 的企业用户

常规风险

  • API 密钥泄露风险:NOVA_ACT_API_KEY 需妥善保管
  • 网页结构变化导致自动化失效(所有浏览器自动化共性风险)
  • 过度依赖 AI 理解可能产生非确定性行为,关键流程需人工复核
  • 痕迹文件残留造成的数据泄露风险

技能正文


name: nova-act description: Write and execute Python scripts using Amazon Nova Act for AI-powered browser automation tasks like flight searches, data extraction, and form filling. homepage: https://nova.amazon.com/act metadata: { "openclaw": { "emoji": "🌐", "requires": { "bins": ["uv"], "env": ["NOVA_ACT_API_KEY"] }, "primaryEnv": "NOVA_ACT_API_KEY", "install": [ { "id": "uv-brew", "kind": "brew", "formula": "uv", "bins": ["uv"], "label": "Install uv (brew)", }, ], }, }

Nova Act Browser Automation

Use Amazon Nova Act for AI-powered browser automation. The bundled script handles common tasks; write custom scripts for complex workflows. To get free API key go to https://nova.amazon.com/dev/api

Data & Privacy Notice

What this skill accesses:

  • Reads: NOVA_ACT_API_KEY environment variable or ~/.openclaw/openclaw.json (your API key)
  • Writes: Nova Act trace files in the current working directory (screenshots, session recordings)

What trace files may contain:

  • Screenshots of every page visited
  • Full page content (HTML, text)
  • Browser actions and AI decisions

Recommendations:

  • Be aware traces may capture PII or sensitive data visible on visited pages
  • Review/delete trace files after use if they contain sensitive content

Safety Guardrails

Instructions for the AI Agent

ALWAYS stop before actions that cause monetary impact, external communication, account creation, or data modification.

When a task involves material-impact actions (see MATERIAL_IMPACT_KEYWORDS in scripts/nova_act_runner.py), you MUST:

  1. Navigate TO the final step (checkout page, submit button, publish screen)
  2. Verify the final action is accessible (button exists, is enabled)
  3. Use act_get() to observe without acting — DO NOT click the final action button
  4. Report findings to the user without completing the action

Categories requiring safety stops:

  • Monetary: buy, purchase, checkout, pay, subscribe, donate, order
  • Communication: post, publish, share, send, email, message, tweet
  • Account creation: sign up, register, create account, join
  • Submissions: submit, apply, enroll, book, reserve
  • Destructive: delete, remove, cancel

Safety Guarantees

When performing browser automation, this skill will NEVER:

  • Complete actual purchases or financial transactions
  • Create real accounts or sign up for services
  • Post content publicly on any platform
  • Send emails, messages, or communications
  • Submit forms that cause irreversible real-world actions

This skill will ALWAYS:

  • Stop before any action that could have material real-world impact
  • Ask for explicit user confirmation before taking irreversible actions
  • Report findings rather than completing destructive operations
  • Document safety stops in output when material-impact actions are detected

See references/nova-act-cookbook.md for detailed safe workflow patterns.

Quick Start with Bundled Script

When asked to perform a browser automation task, invoke the bundled script:

import subprocess, os, sys

skill_dir = os.path.expanduser("~/.openclaw/skills/nova-act")
script = os.path.join(skill_dir, "scripts", "nova_act_runner.py")

result = subprocess.run(
    ["uv", "run", script, "--url", url, "--task", task],
    capture_output=True, text=True, env={**os.environ}
)
print(result.stdout)
if result.returncode != 0:
    print(result.stderr, file=sys.stderr)

Where url and task are Python string variables set from the user's request.

The script uses a generic schema (summary + details list) to capture output.

Writing Custom Scripts

For complex multi-step workflows or specific extraction schemas, write a custom Python script with PEP 723 dependencies:

#!/usr/bin/env python3
# /// script
# requires-python = ">=3.10"
# dependencies = ["nova-act"]
# ///

from nova_act import NovaAct

with NovaAct(starting_page="https://example.com") as nova:
    # Execute actions with natural language
    # Combine steps into a single act() call to maintain context
    nova.act("Click the search box, type 'automation', and press Enter")

    # Extract data with schema
    results = nova.act_get(
        "Get the first 5 search result titles",
        schema=list[str]
    )
    print(results)

    # Take screenshot
    nova.page.screenshot(path="search_results.png")
    print(f"MEDIA: {Path('search_results.png').resolve()}")

Run with: uv run script.py

Core API Patterns

nova.act(prompt) - Execute Actions

Use for clicking, typing, scrolling, navigation. Note: Context is best maintained within a single act() call, so combine related steps.

nova.act("""
    Click the search box.
    Type 'automation tools' and press Enter.
    Scroll down to the results section.
    Select 'Relevance' from the sort dropdown.
""")

nova.act_get(prompt, schema) - Extract Data

Use Pydantic models or Python types for structured extraction:

from pydantic import BaseModel

class Flight(BaseModel):
    airline: str
    price: float
    departure: str
    arrival: str

# Extract single item
flight = nova.act_get("Get the cheapest flight details", schema=Flight)

# Extract list
flights = nova.act_get("Get all available flights", schema=list[Flight])

# Simple types
price = nova.act_get("What is the total price?", schema=float)
items = nova.act_get("List all product names", schema=list[str])

Common Use Cases

Flight Search

with NovaAct(starting_page="https://google.com/flights") as nova:
    # Combine steps to ensure the agent maintains context through the flow
    nova.act("""
        Search for round-trip flights from SFO to JFK.
        Set departure date to March 15, 2025.
        Set return date to March 22, 2025.
        Click Search.
        Sort by price, lowest first.
    """)

    flights = nova.act_get(
        "Get the top 3 cheapest flights with airline, price, and times",
        schema=list[Flight]
    )
    # SAFETY STOP: Only extracted data. Did NOT select a flight or proceed to booking.

Form Filling

with NovaAct(starting_page="https://example.com/contact") as nova:
    nova.act("""
        Fill the form: name 'Test User', email 'test@example.com'.
        Select 'United States' for country.
    """)

    # SAFETY STOP: Verify submit button exists but DO NOT click it
    submit_ready = nova.act_get(
        "Is there a submit button visible and enabled?",
        schema=bool
    )
    print(f"Form ready to submit: {submit_ready}")

Data Extraction

with NovaAct(starting_page="https://news.ycombinator.com") as nova:
    stories = nova.act_get(
        "Get the top 10 story titles and their point counts",
        schema=list[dict]  # Or use a Pydantic model
    )

Best Practices

  1. Combine steps: Nova Act maintains context best within a single act() call. Combine related actions into one multi-line prompt.
  2. Use specific dates: The browser agent may struggle with relative dates like "next Monday". Always calculate and provide specific dates (e.g., "March 15, 2025") in the task prompt.
  3. Be specific in prompts: "Click the blue 'Submit' button at the bottom" is better than "Click submit"
  4. Use schemas for extraction: Always provide a schema to act_get() for structured data
  5. Handle page loads: Nova Act waits for stability, but add explicit waits for dynamic content if needed
  6. Take screenshots for verification: Use nova.page.screenshot() to capture results

Resources

  • references/nova-act-cookbook.md — Best practices and safety patterns for Nova Act, including MATERIAL_IMPACT_KEYWORDS documentation and safe workflow examples. The AI agent should consult this for complex automation tasks.
  • README.md — User-facing installation and safety overview.

API Key

  • NOVA_ACT_API_KEY env var (required)
  • Or set skills."nova-act".apiKey / skills."nova-act".env.NOVA_ACT_API_KEY in ~/.openclaw/openclaw.json

Notes

  • Nova Act launches a real Chrome browser; ensure display is available or use headless mode
  • The script prints MEDIA: lines for OpenClaw to auto-attach screenshots on supported providers
  • For headless operation: NovaAct(starting_page="...", headless=True)
  • Access underlying Playwright page via nova.page for advanced operations

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

browser-automationweb-scrapingawsamazon-novaai-agentplaywrightdata-extraction

同类 Skill