Capture Website Screenshot
Take screenshots of any website and send to user.
Quick Start
CODEBLOCK0
Common Options
| Option | 说明 | 示例 |
|---|
| INLINECODE0 | 输出文件路径 | INLINECODE1 |
| INLINECODE2 |
截取完整页面 |
--full-page |
|
--width | 页面宽度 |
--width=1280 |
|
--height | 页面高度 |
--height=800 |
|
--type | 图片格式 |
--type=png 或
--type=jpeg |
|
--delay | 加载后等待秒数 |
--delay=2 |
|
--wait-for-element | 等待元素出现 |
--wait-for-element=.content |
|
--dark-mode | 暗色模式 |
--dark-mode |
|
--emulate-device | 模拟设备 |
--emulate-device="iPhone X" |
Workflow
- 1. Run capture-website command with URL
- Save to workspace folder: INLINECODE19
- Send via message tool with filePath
Example
CODEBLOCK1
Then send the file to user via Discord.
Notes
- - Requires: INLINECODE20
- Default timeout: 60 seconds
- If screenshot fails, try adding
--delay=2 for slow-loading pages
捕获网站截图
捕获任意网站的截图并发送给用户。
快速开始
bash
capture-website --output=/home/aaronz/.openclaw/workspace/screenshot.png
常用选项
| 选项 | 说明 | 示例 |
|---|
| --output | 输出文件路径 | --output=/tmp/screenshot.png |
| --full-page |
截取完整页面 | --full-page |
| --width | 页面宽度 | --width=1280 |
| --height | 页面高度 | --height=800 |
| --type | 图片格式 | --type=png 或 --type=jpeg |
| --delay | 加载后等待秒数 | --delay=2 |
| --wait-for-element | 等待元素出现 | --wait-for-element=.content |
| --dark-mode | 暗色模式 | --dark-mode |
| --emulate-device | 模拟设备 | --emulate-device=iPhone X |
工作流程
- 1. 使用URL运行capture-website命令
- 保存到工作区文件夹:/home/aaronz/.openclaw/workspace/
- 通过消息工具发送文件,附带文件路径
示例
bash
capture-website https://x.com/elonmusk/status/2026052687423562228 \
--output=/home/aaronz/.openclaw/workspace/tweet.png \
--width=1280 \
--height=800
然后通过Discord将文件发送给用户。
注意事项
- - 需要:npm install -g capture-website-cli
- 默认超时:60秒
- 如果截图失败,可尝试添加 --delay=2 参数以应对加载缓慢的页面