Actions8
Overview
This node integrates with the HeadlessX API to perform various web automation tasks such as web scraping, capturing screenshots, generating PDFs, rendering content, and batch processing. It is useful for automating data extraction from websites, creating visual snapshots of web pages, or converting web content into PDF documents.
Common scenarios include:
- Taking screenshots of web pages in different device emulations (desktop, mobile, tablet).
- Scraping HTML or content via GET or POST requests.
- Generating PDFs from web pages.
- Rendering dynamic content.
- Processing multiple URLs or tasks in batch mode.
For example, you could use this node to capture a full-page screenshot of a product page on an e-commerce site with ads hidden, or generate a PDF report from a dashboard URL.
Properties
| Name | Meaning |
|---|---|
| Additional Options | A collection of optional settings to customize the screenshot or capture behavior: |
| - Capture Full Page | Whether to capture the entire scrollable page or just the visible viewport. |
| - Custom Height | Custom viewport height in pixels (only if Device Emulation is set to "Custom"). Range: 100-4000. |
| - Custom Width | Custom viewport width in pixels (only if Device Emulation is set to "Custom"). Range: 100-4000. |
| - Dark Mode | Enable dark mode styling for the screenshot. |
| - Device Emulation | Choose device type for screenshot capture. Options: Custom, Desktop (1920x1080), Mobile Phone (375x667), Mobile Phone Landscape (667x375), Tablet (768x1024), Tablet Landscape (1024x768). |
| - Disable Animations | Disable CSS animations and transitions before taking the screenshot. |
| - Extra Wait Time (MS) | Additional wait time in milliseconds before taking the screenshot, allowing dynamic content to load. Range: 0-30000. |
| - Format | Image format for the screenshot. Options: JPEG (lossy), PNG (lossless), WebP (modern compression). |
| - Hide Elements | CSS selectors (comma-separated) of elements to hide 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 remove from the DOM before taking the screenshot. |
| - Scroll Behavior | How scrolling is handled during screenshot capture. Options: Auto, Instant (no animation), Smooth (animated scrolling). |
| - Timeout | Request timeout in milliseconds. Range: 1000-120000. |
| - User Agent | Custom user agent string to use for the request. Leave empty to use default. |
| - Wait for Network Idle | Whether to wait until network activity has finished before taking the screenshot. |
| - 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 results of the requested operation. For screenshot operations, the output includes image data encoded in base64 within the binary property, representing the captured screenshot in the selected format (JPEG, PNG, or WebP).
For other operations like HTML or content retrieval, PDF generation, or rendering, the output JSON contains the respective data returned by the HeadlessX API.
If errors occur and "Continue On Fail" is enabled, the output will contain error details including message, operation name, and timestamp.
Dependencies
- Requires an API key credential for authenticating with the HeadlessX API.
- The node uses the HeadlessX API base URL configured in the credentials.
- No additional environment variables are required beyond the API authentication setup.
Troubleshooting
- Unknown Operation Error: If an unsupported operation is specified, the node throws an error indicating "Unknown operation". Ensure the operation parameter is correctly set to one of the supported values (e.g., htmlGet, screenshot, pdf).
- Timeouts: Requests may fail if the timeout is too low for slow-loading pages. Increase the "Timeout" property to allow more time.
- Selector Not Found: If using "Wait for Selector", the node may timeout if the selector does not appear. Verify the correctness of the CSS selector.
- Invalid CSS Selectors: Incorrect syntax in "Hide Elements" or "Remove Elements" can cause unexpected behavior. Use valid CSS selectors separated by commas.
- Image Quality Issues: Setting very low quality for JPEG/WebP may degrade image clarity. Adjust the "Quality" property accordingly.
- API Authentication Errors: Ensure the API key credential is valid and has access to the HeadlessX service.