Browserless icon

Browserless

Interact with Browserless API

Actions5

Overview

The node integrates with the Browserless API to perform various browser automation tasks such as capturing screenshots, scraping JSON data, rendering content, generating PDFs, and executing custom JavaScript functions in a headless browser environment.

For the Screenshot Capture operation specifically, the node visits a target URL and captures an image of the webpage. It supports advanced options like resizing, clipping, encoding format, full-page capture, background omission, and image quality settings. This is useful for automated website monitoring, visual regression testing, or archiving web pages.

Practical examples:

  • Automatically capture screenshots of product pages for visual comparison.
  • Generate thumbnails of websites for previews.
  • Capture screenshots of dynamic web content after running scripts or waiting for page load events.

Properties

Name Meaning
URL The target webpage URL to visit and capture.
Manipulate Resize options for the captured image including flipping (horizontal/vertical), rotation angle, fit mode (contain, cover, fill, inside, outside), dimensions (width, height), and position anchor for fitting.
Image Options Settings related to the screenshot image output:
- Clip: Defines a rectangular region (x, y, width, height) to capture.
- Encoding: Output format, either Base64 string or binary.
- Full Page: Capture entire page.
- Omit Background: Remove default background.
- Quality: Compression quality for JPEG.
- Type: Image format (jpeg or png).
Browser Options Browser runtime configurations:
- BlockAds: Block ad network traffic.
- Headless: Run browser without UI.
- Ignore HTTPS Errors: Allow insecure HTTPS.
- Stealth: Avoid bot detection.
- User Data Dir: Path for session data.
- TrackingId: Custom ID for tracking.
- Keep Alive: Time to keep browser open.
- Flags: Additional Chrome command-line flags.
Additional Options Extra HTTP headers, script/style injections, basic authentication, cookies, navigation options (timeout, waitUntil), request blocking patterns/types, request interceptors, user agent string, JavaScript enablement, viewport settings.

Output

  • The node outputs the screenshot image data in the binary property under the key data.
  • The json output is empty ({}) for this operation.
  • The binary data represents the captured screenshot image encoded according to the selected encoding option (Base64 or raw binary).
  • This binary output can be used downstream for saving files, sending emails, or further processing.

Dependencies

  • Requires access to the Browserless API service endpoint.
  • Needs an API authentication token configured in n8n credentials to authorize requests.
  • No other external dependencies are required.
  • Optional: Users may configure additional browser options and HTTP headers to customize the browsing context.

Troubleshooting

  • Common issues:

    • Invalid or unreachable URL causing request failures.
    • Authentication errors if API key is missing or invalid.
    • Timeout errors if the page takes too long to load.
    • Incorrect clip dimensions leading to empty or partial screenshots.
    • Unsupported image type or encoding causing output errors.
  • Error messages and resolutions:

    • "Request failed": Check URL validity and network connectivity.
    • "Authentication failed": Verify API key credential configuration.
    • "Timeout exceeded": Increase timeout in navigation options or check page responsiveness.
    • "Invalid clip dimensions": Ensure clip coordinates and sizes are within page bounds.
    • "Unsupported image type": Use only supported formats (jpeg, png).

Links and References

Discussion