Files
chatrebot_aireply_plug/skills/browser/SKILL.md
Claw e1fbd31c64 完整 AgentSkill:词库外部化 + 全部脚本/Skill 脱敏上传
- 高危词库从 process.py 抽到 config.toml [security] section
- process.py 改为 _get_high_risk_words() 动态加载(配置优先)
- 新增 15 个 QQ 操作脚本(已脱敏:QQ号/IP/Token → 占位符)
- 新增 8 个 SKILL.md(qq-messenger/management/resolver/napcat-extras 等)
- 新增 SKILL.md 入口(完整部署方案文档)
- 保留 SDK 框架(plugin_modules.py, file_store_api.py, package.py 等)
2026-05-04 16:23:59 +08:00

48 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 无头浏览器 Skill
当用户发来网页链接需要查看页面内容时使用。可以获取页面文字内容或截图。
## 环境
- 浏览器:系统 Chromium(/usr/local/bin/chromium)
- 驱动:Playwright(需在 self-workplace/.venv 中运行)
- 注意:某些网站反爬可能拒绝访问
## 使用方法
### 1. 获取页面文字内容
```bash
self-workplace/.venv/bin/python3 scripts/browse.py "https://example.com"
```
输出:页面标题 + 正文文字(前5000字符)
### 2. 截图保存
```bash
self-workplace/.venv/bin/python3 scripts/browse.py "https://example.com" --screenshot
```
截图会保存到 `files/screenshot_xxx.png`,可以调用 `qq_send_file.py` 发给用户查看。
### 3. JS 渲染页面(需要等一会儿再抓取)
```bash
self-workplace/.venv/bin/python3 scripts/browse.py "https://example.com" --wait 3
```
`--wait 3` 表示等待3秒让 JS 执行完毕再提取内容。
## 典型场景
1. **用户发了个链接想让你看** → 用 browse.py 获取文字内容,复述给用户
2. **页面需要截图才能看清**(图表、图片为主)→ `--screenshot` 截图,然后发图片给用户
3. **页面内容很长** → 自动截取前5000字符,告诉用户剩余内容长度
## 注意事项
- 某些网站(需登录、验证码、Cloudflare等)可能无法正常访问
- 单页面最多等15秒,超时会打印已获取的内容
- 截图是全页截图,可能很大(长页面),发送前注意文件大小