Actions8
Overview
This node integrates with the HeadlessX API to capture screenshots of web pages. It allows users to specify a URL and customize how the screenshot is taken, including device emulation, viewport size, image format, and other options. This node is useful for automating visual captures of websites for monitoring, testing, archiving, or content verification purposes.
Practical examples include:
- Taking full-page screenshots of a website to monitor UI changes over time.
- Capturing mobile or tablet views of a webpage to verify responsive design.
- Removing or hiding unwanted page elements like ads or popups before capturing.
- Generating screenshots in different image formats (PNG, JPEG, WebP) with quality control.
Properties
| Name | Meaning |
|---|---|
| URL | The web page URL to capture as a screenshot. Must be a valid URL. |
| Additional Options | A collection of optional settings to customize the screenshot: |
| Capture Full Page | Whether to capture the entire scrollable page or just the visible viewport. Defaults to true. |
| Custom Height | Custom viewport height in pixels (100–4000). Only used if Device Emulation is set to "Custom". Default is 1080. |
| Custom Width | Custom viewport width in pixels (100–4000). Only used if Device Emulation is set to "Custom". Default is 1920. |
| Dark Mode | Enable dark mode styling for the screenshot. Defaults to false. |
| Device Emulation | Choose device type for viewport dimensions: Custom, Desktop (1920x1080), Mobile Phone (375x667), Mobile Phone Landscape (667x375), Tablet (768x1024), Tablet Landscape (1024x768). Default is Desktop. |
| Disable Animations | Disable CSS animations and transitions during capture to avoid motion artifacts. Defaults to true. |
| Extra Wait Time (MS) | Additional wait time in milliseconds before taking the screenshot to allow dynamic content to load. Range 0–30000. Default is 2000 ms. |
| Format | Image format for the screenshot: JPEG (lossy, smaller size), PNG (lossless, larger size), WebP (modern, best compression). Default is PNG. |
| Hide Elements | CSS selectors (comma-separated) of elements to hide (visibility hidden) before taking the screenshot, e.g., ".ads, #popup". |
| Quality | Image quality from 1 to 100, applicable only to JPEG and WebP formats. Default is 80. |
| Remove Elements | CSS selectors (comma-separated) of elements to completely remove from the DOM before taking the screenshot, e.g., ".ads, #popup". |
| Scroll Behavior | How scrolling is handled during capture: Auto (default), Instant (no animation), Smooth (animated scrolling). Default is Auto. |
| Timeout | Request timeout in milliseconds (1000–120000). Default is 30000 ms. |
| User Agent | Custom user agent string to use when loading the page. Leave empty to use default. |
| Wait for Network Idle | Whether to wait until network activity has finished before taking the screenshot. Defaults to true. |
| Wait for Selector | CSS selector to wait for before taking the screenshot, ensuring specific content has loaded, e.g., ".content-loaded". |
Output
The node outputs JSON data containing the screenshot image encoded in base64 format. The output typically includes:
json: An object with metadata about the screenshot operation.binary: The actual screenshot image file in the selected format (PNG, JPEG, or WebP).
The binary data can be used downstream in workflows for saving to disk, uploading, or further processing.
Dependencies
- Requires an active connection to the HeadlessX API service.
- Needs an API authentication token configured in the node credentials.
- The node depends on network access to the target URLs.
- No additional environment variables are required beyond the API credential setup.
Troubleshooting
Common Issues:
- Invalid or unreachable URL: Ensure the URL is correct and accessible from the n8n server environment.
- Timeout errors: Increase the "Timeout" property if pages take longer to load.
- Authentication failures: Verify that the API key credential is correctly configured and has necessary permissions.
- Incorrect CSS selectors in "Hide Elements" or "Remove Elements" may cause unexpected results or no effect.
Error Messages:
"Unknown operation": Indicates an unsupported operation was selected; ensure "Take Screenshot" is chosen.- API request errors with HTTP status codes: Check network connectivity and API key validity.
- Validation errors on input properties: Confirm all required fields are filled and values are within allowed ranges.