Browserless icon

Browserless

Browserless API

Overview

This node interacts with the Browserless API to perform browser automation tasks, specifically supporting a 'Download' operation under the 'Browser Rest Apis' resource. It allows users to execute custom JavaScript code in a browser context to download or retrieve data, with options to configure browser launch parameters, ad-blocking, timeouts, and request options. This node is useful for scenarios such as automated web scraping, downloading content from web pages, or running browser-based scripts programmatically.

Use Case Examples

  1. Automate downloading JSON data from a web page by providing custom JavaScript code.
  2. Use the node to launch a headless browser session with specific viewport settings and download content while blocking ads.
  3. Set a custom timeout and proxy settings to handle slow or restricted network environments during browser automation.

Properties

Name Meaning
Code JavaScript code to execute in the browser context for the download operation.
Context JSON object providing context or parameters to the JavaScript code executed in the browser.
Timeout Override the system-level timeout for the request in milliseconds.
Block Ads Boolean flag to enable or disable loading ad-blocking extensions during the browser session.
Enable Launch Boolean flag to launch a new browser instance for the operation.
Launch Collection of options to configure the browser launch parameters such as arguments, viewport settings, devtools, headless mode, and more.
Use Custom Body Flag to indicate whether to use a custom request body instead of the default.
Custom Body Custom JSON body to send if 'Use Custom Body' is enabled.
Request Options Node-level request options including batching, SSL certificate handling, proxy settings, and timeout.

Output

JSON

  • hello - Example output property from the executed JavaScript code indicating a greeting message.
  • type - MIME type of the downloaded content, e.g., 'application/json'.

Dependencies

  • Browserless API

Troubleshooting

  • Ensure the JavaScript code provided in the 'Code' property is valid and returns the expected output format.
  • If the browser fails to launch, verify the 'Enable Launch' and 'Launch' configuration options are correctly set.
  • Timeout errors may occur if the 'Timeout' property is set too low; increase it as needed.
  • Ad-blocking may cause some sites to not load properly; disable 'Block Ads' if encountering loading issues.
  • Proxy settings must be correctly formatted; incorrect proxy URLs can cause connection failures.

Links

Discussion