← 返回 Skills 市场
linzmin

Dynamic Web Fetch

作者 linzmin · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
123
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install dynamic-webfetch
功能描述
动态网页抓取工具 - 使用 Playwright 支持 JavaScript 渲染的网页内容抓取
使用说明 (SKILL.md)

Dynamic Web Fetch Skill

支持 JavaScript 动态加载的网页内容抓取工具,使用 Playwright 无头浏览器。

特点

  • 🚀 支持动态加载 - 执行 JavaScript,等待页面完全渲染
  • 🎯 智能等待 - 可配置等待时间或等待特定元素
  • 📝 多格式输出 - 支持 Markdown、文本、HTML 格式
  • 🔍 元素提取 - 可选择性提取特定 CSS 选择器的内容
  • 📸 截图支持 - 可选保存页面截图
  • 快速加载 - 使用 DOMContentLoaded 策略,加快页面加载

依赖

pip install playwright
playwright install chromium

使用方法

基本用法

result = main({
    "action": "fetch",
    "url": "https://example.com",
    "format": "text",
    "wait_seconds": 3
})

高级用法

result = main({
    "action": "fetch",
    "url": "https://m.cngold.org/quote/gjs/jjs_hj9999.html",
    "format": "text",
    "wait_selector": ".price",
    "wait_seconds": 5,
    "screenshot": "/tmp/gold-price.png"
})

输入参数

参数 类型 必填 说明
action string 操作类型:fetch
url string 目标 URL
format string 输出格式:markdown/text/html,默认 markdown
wait_seconds int 等待时间(秒),默认 3
wait_selector string CSS 选择器,等待该元素出现
screenshot string 截图保存路径(可选)
user_agent string 自定义 User-Agent
timeout int 页面加载超时时间(毫秒),默认 30000

输出格式

{
    "success": true,
    "url": "https://...",
    "title": "页面标题",
    "format": "text",
    "content": "页面内容...",
    "timestamp": "2026-04-09T08:00:00Z"
}

示例

示例 1:抓取实时金价

result = main({
    "action": "fetch",
    "url": "https://m.cngold.org/quote/gjs/jjs_hj9999.html",
    "format": "text",
    "wait_seconds": 5
})

if result["success"]:
    print(result["content"])

示例 2:抓取并截图

result = main({
    "action": "fetch",
    "url": "https://finance.sina.com.cn/",
    "format": "markdown",
    "wait_seconds": 3,
    "screenshot": "/tmp/sina-finance.png"
})

示例 3:等待特定元素

result = main({
    "action": "fetch",
    "url": "https://quote.eastmoney.com/globalfuture/au9999.html",
    "format": "text",
    "wait_selector": ".quote-price",
    "wait_seconds": 8
})

命令行用法

# JSON 模式
echo '{"url": "https://example.com", "wait_seconds": 5}' | python3 scripts/fetch.py

# 命令行模式
python3 scripts/fetch.py https://example.com text 5

注意事项

  1. 首次运行需要安装 Playwright 和浏览器:pip install playwright && playwright install chromium
  2. 动态页面加载时间较长,建议设置合理的 wait_seconds(3-8 秒)
  3. 部分网站可能有反爬虫机制,建议设置合适的 User-Agent
  4. 截图功能会增加执行时间
  5. 东方财富等网站可能有反爬,建议使用金投网等替代源

推荐数据源

网站 URL 说明
金投网 https://m.cngold.org/quote/gjs/jjs_hj9999.html AU9999 实时行情 ✅
上海黄金交易所 https://www.sge.com.cn/ 官方数据
新浪财经 https://finance.sina.com.cn/ 财经新闻

动态,但稳定。 🦆

安全使用建议
This skill appears to do what it says: run a headless Playwright browser to fetch rendered page content. Before installing or invoking it: 1) Review the scripts/fetch.py file (already included) and only run it in an isolated environment (container/VM) to limit damage if misused. 2) Be cautious about passing URLs you don’t fully trust — the skill can access internal network endpoints or metadata services. 3) The install step downloads Chromium via Playwright; ensure you install from the official pip/Playwright channels. 4) When using the screenshot option, pick safe file paths to avoid overwriting important files. 5) If you need stricter controls, restrict allowed target domains or add input validation/sandboxing before granting the skill network access.
功能分析
Type: OpenClaw Skill Name: dynamic-webfetch Version: 1.0.0 The dynamic-webfetch skill is a legitimate utility for scraping JavaScript-rendered websites using the Playwright library. The core logic in scripts/fetch.py correctly implements browser automation, content extraction, and optional screenshotting without any evidence of data exfiltration, unauthorized file access, or malicious command execution. The instructions in SKILL.md are consistent with the tool's stated purpose and do not contain prompt injection attacks.
能力评估
Purpose & Capability
Name/description, SKILL.md, README, and scripts/fetch.py consistently implement a Playwright-based dynamic web fetcher. The dependencies and runtime behavior (install Playwright, launch headless chromium, fetch pages, optional screenshot) are expected for this purpose.
Instruction Scope
Runtime instructions and the Python script accept arbitrary URLs, optionally save screenshots to arbitrary paths, and render/extract page content. This is expected for a scraper, but it also means the skill can be used to access internal network resources or metadata endpoints (SSRF-like risk) and write files locally. The SKILL.md does not constrain allowed domains or sanitize inputs.
Install Mechanism
The manifest has no automated install spec, but SKILL.md instructs users to run `pip install playwright` and `playwright install chromium`. This is a standard install flow; it will download browser binaries from Playwright's installation endpoints and write them to disk. No unusual or obfuscated download URLs are present in the package itself.
Credentials
The skill requests no environment variables, no credentials, and no config paths. The code does not try to read secrets or other environment data beyond parameters supplied at runtime, which is proportionate to a web scraper.
Persistence & Privilege
The skill is not marked always:true and does not alter other skills or system-wide agent settings. It can be invoked autonomously (platform default), which is normal; combined with the ability to fetch arbitrary URLs this increases potential impact, but that is an intrinsic capability of any web-fetch skill rather than an unexpected privilege escalation.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install dynamic-webfetch
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /dynamic-webfetch 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of dynamic-webfetch. - 支持使用 Playwright 无头浏览器抓取动态(JavaScript 渲染)网页内容 - 可配置等待时间或指定 CSS 选择器实现智能等待 - 输出格式支持 markdown、纯文本、HTML - 支持按需提取指定元素内容 - 可选保存页面截图 - 支持自定义 User-Agent 和页面加载超时参数
元数据
Slug dynamic-webfetch
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Dynamic Web Fetch 是什么?

动态网页抓取工具 - 使用 Playwright 支持 JavaScript 渲染的网页内容抓取. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 123 次。

如何安装 Dynamic Web Fetch?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install dynamic-webfetch」即可一键安装,无需额外配置。

Dynamic Web Fetch 是免费的吗?

是的,Dynamic Web Fetch 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Dynamic Web Fetch 支持哪些平台?

Dynamic Web Fetch 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Dynamic Web Fetch?

由 linzmin(@linzmin)开发并维护,当前版本 v1.0.0。

💬 留言讨论