Auto Browser icon

Auto Browser

Automates browser actions

Overview

The "Auto Browser" node automates browser actions by interacting with a remote browser automation service via HTTP requests. It supports various operations such as navigating to URLs, clicking elements, typing text, waiting for selectors, pressing keys, executing scripts, and closing tabs within a specified browser profile and tab.

This node is beneficial in scenarios where automated web interactions are needed without manual browser control, such as:

  • Automating form submissions or data entry on websites.
  • Navigating through multi-step web workflows.
  • Extracting information by running custom scripts on pages.
  • Testing web page behavior by simulating user inputs.
  • Managing multiple browser tabs programmatically.

For example, you could use this node to navigate to a login page, type credentials into input fields, press the Enter key to submit, wait for a selector indicating successful login, and then execute a script to extract user-specific data.

Properties

Name Meaning
Profile The browser profile identifier to use for the operation.
Tab ID Optional identifier of the browser tab to target for the operation.
Key (Only for "Press Key" operation) The keyboard key to simulate pressing. Options: Enter, Tab, Escape, Backspace

Output

The node outputs JSON objects representing the result of each executed action. The structure generally includes:

  • profileId: The browser profile used.
  • tabId: The tab identifier where the action was performed.
  • operation: The operation name executed (e.g., "press", "navigate").
  • status: The status of the operation, typically "success" or "error".
  • Additional fields depending on the operation:
    • For "navigate": includes the navigated URL.
    • For "executeScript": includes a data field containing the result of the script execution.
    • For other operations, no additional data beyond status and identifiers is returned.

The node does not output binary data.

Dependencies

  • Requires an external browser automation API service accessible via HTTP.
  • Needs an API authentication credential configured in n8n to access the service.
  • The service URL must be provided in the credential configuration.
  • The node sends POST requests to endpoints like /browser/execute and DELETE requests to close tabs.

Troubleshooting

  • Missing Server URL: If the server URL is not found in the credentials, the node will throw an error. Ensure the API credential is properly configured with the correct server URL.
  • Invalid Profile or Tab ID: Using incorrect or non-existent profile or tab IDs may cause failures. Verify that the profile exists and the tab ID is valid.
  • Timeouts or Selector Not Found: When waiting for selectors, if the element does not appear within the timeout, the operation may fail. Adjust the timeout or verify the selector correctness.
  • Script Execution Errors: Scripts passed to the "Execute Script" operation must be valid JavaScript. Syntax errors or runtime exceptions in the script will cause errors.
  • Network Issues: Since the node depends on HTTP requests to an external service, network connectivity problems can cause failures.
  • Use the "Continue On Fail" option to handle errors gracefully and continue processing subsequent items.

Links and References

Discussion