← Back to Skills Marketplace
123
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install dynamic-webfetch
Description
动态网页抓取工具 - 使用 Playwright 支持 JavaScript 渲染的网页内容抓取
README (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
注意事项
- 首次运行需要安装 Playwright 和浏览器:
pip install playwright && playwright install chromium - 动态页面加载时间较长,建议设置合理的 wait_seconds(3-8 秒)
- 部分网站可能有反爬虫机制,建议设置合适的 User-Agent
- 截图功能会增加执行时间
- 东方财富等网站可能有反爬,建议使用金投网等替代源
推荐数据源
| 网站 | URL | 说明 |
|---|---|---|
| 金投网 | https://m.cngold.org/quote/gjs/jjs_hj9999.html | AU9999 实时行情 ✅ |
| 上海黄金交易所 | https://www.sge.com.cn/ | 官方数据 |
| 新浪财经 | https://finance.sina.com.cn/ | 财经新闻 |
动态,但稳定。 🦆
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install dynamic-webfetch - After installation, invoke the skill by name or use
/dynamic-webfetch - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of dynamic-webfetch.
- 支持使用 Playwright 无头浏览器抓取动态(JavaScript 渲染)网页内容
- 可配置等待时间或指定 CSS 选择器实现智能等待
- 输出格式支持 markdown、纯文本、HTML
- 支持按需提取指定元素内容
- 可选保存页面截图
- 支持自定义 User-Agent 和页面加载超时参数
Metadata
Frequently Asked Questions
What is Dynamic Web Fetch?
动态网页抓取工具 - 使用 Playwright 支持 JavaScript 渲染的网页内容抓取. It is an AI Agent Skill for Claude Code / OpenClaw, with 123 downloads so far.
How do I install Dynamic Web Fetch?
Run "/install dynamic-webfetch" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Dynamic Web Fetch free?
Yes, Dynamic Web Fetch is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Dynamic Web Fetch support?
Dynamic Web Fetch is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Dynamic Web Fetch?
It is built and maintained by linzmin (@linzmin); the current version is v1.0.0.
More Skills