Actions5
Screenshot → Capture
AI-generatedOverview
The Browserless node enables interaction with the Browserless API to automate browser tasks such as capturing screenshots, scraping JSON data, rendering content, executing custom JavaScript functions, and generating PDFs from web pages. This node is useful for workflows that require automated web page processing without managing a local browser instance.
For the Screenshot - Capture operation specifically, the node visits a target URL and captures a screenshot of the page. It supports extensive customization of the screenshot including image format, quality, clipping region, full-page capture, and various browser options like headless mode or ad blocking. This is beneficial for monitoring website appearance, archiving visual states, or generating thumbnails.
Practical examples:
- Automatically capture daily screenshots of a marketing landing page to track design changes.
- Generate preview images of user-submitted URLs in a content curation workflow.
- Capture screenshots of error pages during automated testing for debugging purposes.
Properties
| Name | Meaning |
|---|---|
| URL | The web address of the page to capture. |
| Manipulate | Image manipulation options including flipping, rotating, resizing (width, height), fitting method (contain, cover, fill, inside, outside), and position anchor (top, bottom, left, right, corners). |
| Image Options | Settings for the screenshot image: - Clip: Defines a rectangular region (x, y, width, height) to capture. - Encoding: Output format encoding (Base64 or Binary). - Full Page: Capture entire scrollable page. - Omit Background: Remove background color. - Quality: Compression quality (for JPEG). - Type: Image format (JPEG or PNG). |
| Browser Options | Controls browser behavior: - BlockAds: Block advertisement network traffic. - Headless: Run browser without UI. - Ignore HTTPS Errors: Allow insecure HTTPS connections. - Stealth: Avoid bot detection. - User Data Dir: Path for session data. - TrackingId: Custom ID for tracking. - Keep Alive: Time to keep browser running after session. - Flags: Command-line flags passed to Chrome. |
| Additional Options | Extra HTTP headers, scripts/styles injection, authentication (basic auth), cookies, navigation options (timeout, waitUntil event), request interception patterns, user agent string, JavaScript enable/disable, viewport settings (device scale factor, touch support, dimensions, orientation, mobile emulation). |
Output
- The output contains the captured screenshot image data.
- The
jsonfield is empty ({}). - The
binaryfield contains the screenshot image data under the keydata. - The image data respects the encoding option selected (Base64 or binary buffer).
- This allows downstream nodes to save the image file or process it further.
Dependencies
- Requires an active connection to the Browserless API service.
- Needs an API authentication token configured in n8n credentials (referred generically as "an API key credential").
- No local browser installation is required since the node uses the remote Browserless service.
- Network access to the target URLs is necessary.
Troubleshooting
Common issues:
- Invalid or unreachable URL: The node may fail if the URL is malformed or the server is down.
- Authentication errors: Missing or invalid API key will cause authorization failures.
- Timeout errors: Pages taking too long to load can cause timeouts; adjust the
gotoOptions.timeoutproperty. - Resource blocking: If important resources are blocked by reject patterns or resource types, the screenshot may be incomplete.
- Incorrect clip dimensions: Setting clip coordinates outside the page bounds may result in errors or empty images.
Error messages:
- "Failed to fetch URL": Check URL correctness and network connectivity.
- "Unauthorized": Verify API key credential configuration.
- "Timeout exceeded": Increase timeout or optimize page loading.
- "Invalid clip region": Adjust clip parameters within page size.
Links and References
- Browserless API Documentation
- Chromium Command Line Switches (for browser flags)
- Puppeteer Screenshot Options (Browserless uses Puppeteer under the hood)