截图
🌐 Screenshots
browser_take_screenshot
捕捉当前页面、特定元素或整个可滚动页面。
🌐 Capture the current page, a specific element, or the full scrollable page.
| 参数 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
type | 字符串 | 否 | png(默认)或 jpeg |
ref | 字符串 | 否 | 截取特定元素的引用 |
fullPage | 布尔值 | 否 | 捕获完整可滚动页面 |
页面截图
🌐 Page screenshot
You: Take a screenshot of the current page.
→ browser_take_screenshot
→ Returns: PNG image of the viewport
元素截图
🌐 Element screenshot
You: Take a screenshot of just the login form.
→ browser_take_screenshot { ref: "e12" }
→ Returns: PNG image cropped to the element
整页截图
🌐 Full-page screenshot
You: Take a full-page screenshot including content below the fold.
→ browser_take_screenshot { fullPage: true }
→ Returns: PNG image of entire scrollable page
何时使用截图
🌐 When to use screenshots
截图补充了辅助功能快照:
🌐 Screenshots complement accessibility snapshots:
| 用例 | 最佳工具 |
|---|---|
| 与元素交互 | 辅助功能快照(引用) |
| 验证视觉布局 | 截图 |
| 画布/图表内容 | 截图 |
| 记录错误 | 截图 |
| 了解页面结构 | 辅助功能快照 |
| 阅读文本内容 | 辅助功能快照 |