screenshot-element
Capture a screenshot of a specific webpage element using a CSS selector. Save the image in PNG, JPEG, or WebP format with customizable quality and padding for precise visual verification.
Instructions
Captures a screenshot of a specific element on a webpage using a CSS selector
Input Schema
Name | Required | Description | Default |
---|---|---|---|
format | No | Image format for the screenshot | png |
padding | No | Padding around the element in pixels | |
quality | No | Quality of the image (0-100), only applicable for jpeg and webp | |
selector | Yes | CSS selector for the element to screenshot | |
url | Yes | The URL of the webpage | |
useDefaultBrowser | No | Whether to use the system's default browser instead of Puppeteer's bundled Chromium | |
useSavedAuth | No | Whether to use saved cookies from previous login | |
visibleBrowser | No | Whether to show the browser window (non-headless mode) | |
waitForSelector | No | Whether to wait for the selector to appear |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"format": {
"default": "png",
"description": "Image format for the screenshot",
"enum": [
"png",
"jpeg",
"webp"
],
"type": "string"
},
"padding": {
"default": 0,
"description": "Padding around the element in pixels",
"type": "number"
},
"quality": {
"description": "Quality of the image (0-100), only applicable for jpeg and webp",
"maximum": 100,
"minimum": 0,
"type": "number"
},
"selector": {
"description": "CSS selector for the element to screenshot",
"type": "string"
},
"url": {
"description": "The URL of the webpage",
"format": "uri",
"type": "string"
},
"useDefaultBrowser": {
"default": false,
"description": "Whether to use the system's default browser instead of Puppeteer's bundled Chromium",
"type": "boolean"
},
"useSavedAuth": {
"default": true,
"description": "Whether to use saved cookies from previous login",
"type": "boolean"
},
"visibleBrowser": {
"default": false,
"description": "Whether to show the browser window (non-headless mode)",
"type": "boolean"
},
"waitForSelector": {
"default": true,
"description": "Whether to wait for the selector to appear",
"type": "boolean"
}
},
"required": [
"url",
"selector"
],
"type": "object"
}