web-screenshot
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWeb Screenshot
网页截图
Capture full-page or viewport screenshots of websites using headless Chrome/Chromium.
使用无头Chrome/Chromium捕获网站的整页或视口截图。
Quick Start
快速开始
bash
/job/.pi/skills/web-screenshot/screenshot.js "https://example.com" /tmp/screenshot.pngbash
/job/.pi/skills/web-screenshot/screenshot.js "https://example.com" /tmp/screenshot.pngUsage
使用方法
Basic Screenshot
基础截图
bash
/job/.pi/skills/web-screenshot/screenshot.js "<url>" <output_file>bash
/job/.pi/skills/web-screenshot/screenshot.js "<url>" <output_file>Full Page Screenshot
整页截图
bash
/job/.pi/skills/web-screenshot/screenshot.js "<url>" <output_file> --fullbash
/job/.pi/skills/web-screenshot/screenshot.js "<url>" <output_file> --fullWith Custom Viewport
自定义视口
bash
/job/.pi/skills/web-screenshot/screenshot.js "<url>" <output_file> --width 1920 --height 1080bash
/job/.pi/skills/web-screenshot/screenshot.js "<url>" <output_file> --width 1920 --height 1080With Delay (for dynamic content)
设置延迟(针对动态内容)
bash
/job/.pi/skills/web-screenshot/screenshot.js "<url>" <output_file> --delay 3000bash
/job/.pi/skills/web-screenshot/screenshot.js "<url>" <output_file> --delay 3000Mobile Viewport
移动端视口
bash
/job/.pi/skills/web-screenshot/screenshot.js "<url>" <output_file> --mobilebash
/job/.pi/skills/web-screenshot/screenshot.js "<url>" <output_file> --mobileOptions
参数选项
| Option | Default | Description |
|---|---|---|
| false | Capture full page (scroll height) |
| 1280 | Viewport width in pixels |
| 800 | Viewport height in pixels |
| 0 | Wait time before capture (ms) |
| false | Use mobile viewport (375x667) |
| 80 | JPEG quality (1-100) |
| png | Output format: png, jpeg, webp |
| null | CSS selector to wait for |
| false | Enable dark mode emulation |
| 参数 | 默认值 | 说明 |
|---|---|---|
| false | 捕获整页(包含滚动高度) |
| 1280 | 视口宽度(像素) |
| 800 | 视口高度(像素) |
| 0 | 捕获前等待时间(毫秒) |
| false | 使用移动端视口(375x667) |
| 80 | JPEG质量(1-100) |
| png | 输出格式:png、jpeg、webp |
| null | 等待指定CSS选择器对应的元素加载完成 |
| false | 启用深色模式模拟 |
Output Formats
输出格式
- PNG: Lossless, larger files (default)
- JPEG: Compressed, smaller files, configurable quality
- WebP: Modern format, good compression
- PNG:无损压缩,文件体积较大(默认格式)
- JPEG:有损压缩,文件体积较小,质量可配置
- WebP:现代格式,压缩效果优异
Examples
示例
bash
undefinedbash
undefinedBasic screenshot
基础截图
/job/.pi/skills/web-screenshot/screenshot.js "https://example.com" /tmp/example.png
/job/.pi/skills/web-screenshot/screenshot.js "https://example.com" /tmp/example.png
Full page capture
整页捕获
/job/.pi/skills/web-screenshot/screenshot.js "https://example.com/page" /tmp/full.png --full
/job/.pi/skills/web-screenshot/screenshot.js "https://example.com/page" /tmp/full.png --full
Desktop viewport
桌面端视口
/job/.pi/skills/web-screenshot/screenshot.js "https://example.com" /tmp/desktop.png --width 1920 --height 1080
/job/.pi/skills/web-screenshot/screenshot.js "https://example.com" /tmp/desktop.png --width 1920 --height 1080
Mobile view
移动端视图
/job/.pi/skills/web-screenshot/screenshot.js "https://example.com" /tmp/mobile.png --mobile
/job/.pi/skills/web-screenshot/screenshot.js "https://example.com" /tmp/mobile.png --mobile
Wait for dynamic content
等待动态内容加载
/job/.pi/skills/web-screenshot/screenshot.js "https://example.com" /tmp/delayed.png --delay 5000
/job/.pi/skills/web-screenshot/screenshot.js "https://example.com" /tmp/delayed.png --delay 5000
Wait for specific element
等待指定元素加载
/job/.pi/skills/web-screenshot/screenshot.js "https://example.com" /tmp/wait.png --wait-for ".loaded-content"
/job/.pi/skills/web-screenshot/screenshot.js "https://example.com" /tmp/wait.png --wait-for ".loaded-content"
High quality JPEG
高质量JPEG
/job/.pi/skills/web-screenshot/screenshot.js "https://example.com" /tmp/thumb.jpg --format jpeg --quality 90
/job/.pi/skills/web-screenshot/screenshot.js "https://example.com" /tmp/thumb.jpg --format jpeg --quality 90
Dark mode capture
深色模式捕获
/job/.pi/skills/web-screenshot/screenshot.js "https://example.com" /tmp/dark.png --dark-mode
undefined/job/.pi/skills/web-screenshot/screenshot.js "https://example.com" /tmp/dark.png --dark-mode
undefinedUse Cases
使用场景
- Website thumbnail generation
- Visual regression testing
- Archiving web page appearances
- Creating social media preview images
- Monitoring website changes
- Capturing error states or dynamic content
- 网站缩略图生成
- 视觉回归测试
- 网页外观存档
- 生成社交媒体预览图
- 监控网站变化
- 捕获错误状态或动态内容
When to Use
使用时机
- User requests website screenshot
- Need visual reference for web page
- Creating thumbnails for link previews
- Documenting website state at a point in time
- Testing responsive layouts
- 用户需要网站截图
- 需要网页的视觉参考
- 为链接预览生成缩略图
- 记录某一时刻的网站状态
- 测试响应式布局