CloudBrowser icon

CloudBrowser

Interact with websites using a cloud-based browser instance

Overview

The node provides automation for interacting with websites through a cloud-based browser instance. Specifically, the "Navigation" resource's "Close Browser" operation allows users to close an existing browser session that was previously opened via the node. This is useful in workflows where you want to programmatically manage browser lifecycle—opening a browser, performing navigation or interaction tasks, and then closing it to free resources.

Common scenarios include:

  • Automating web scraping or data extraction workflows where a browser session is opened, navigated, and then closed.
  • Running UI tests or automated interactions on web pages and ensuring the browser closes cleanly afterward.
  • Managing multiple browser sessions in a workflow, explicitly closing them when no longer needed.

Example: After opening a browser and navigating to several pages, use this operation to close the browser instance by providing the WebSocket address returned from the open operation.

Properties

Name Meaning
WebSocket Address The WebSocket address of the browser instance to close. This address is obtained from the Open Browser operation and is required to identify which browser session to close.

Output

The output JSON contains a single field:

  • status: A string indicating the result of the close operation. For example, "Browser closed successfully" confirms the browser was closed without issues.

No binary data is output for this operation.

Example output:

{
  "status": "Browser closed successfully"
}

Dependencies

  • Requires an active API token credential for the cloud browser service to authenticate requests.
  • Uses Puppeteer library to connect to the browser instance via the provided WebSocket address.
  • The node sends HTTP requests to the cloud browser API endpoint to manage browser instances.
  • The environment must allow outbound HTTPS connections to https://production.cloudbrowser.ai.

Troubleshooting

  • Missing or invalid WebSocket Address: If the WebSocket address is not provided or incorrect, the node will fail to connect to the browser instance. Ensure you pass the exact WebSocket address returned from the Open Browser operation.
  • Connection errors: Network issues or firewall restrictions may prevent connecting to the cloud browser service or the browser WebSocket endpoint. Verify network connectivity and proxy settings if applicable.
  • API authentication failures: If the API token credential is missing or invalid, the node will throw authorization errors. Confirm the API token is correctly configured in n8n credentials.
  • Browser already closed: Attempting to close a browser that is already closed or disconnected may cause errors. Handle such cases gracefully by enabling "Continue On Fail" if appropriate.

Links and References

  • Puppeteer Documentation – Used internally to control the browser instance.
  • Cloud Browser API documentation (not publicly linked here) – Refer to your cloud browser provider’s docs for details on API endpoints and authentication.

Discussion