Overview
This node automates web browser interactions by sending commands to a browser server. It supports actions like navigating to URLs, clicking elements, typing text, extracting data, executing JavaScript, waiting for time or elements, taking screenshots, scrolling, selecting dropdown options, getting the current URL, navigating back, reloading the page, and closing the browser session. It is useful for automating repetitive web tasks, scraping data, testing web pages, or controlling a browser programmatically.
Use Case Examples
- Navigate to a webpage and extract data from specific elements.
- Automate form filling by typing text and clicking buttons.
- Take screenshots of web pages at different stages.
- Execute custom JavaScript on a page to retrieve dynamic content.
Properties
| Name | Meaning |
|---|---|
| Server URL | URL of the browser automation server to send commands to. |
| Timeout de Request (segundos) | Maximum time to wait for the request to complete, in seconds. |
| Acción | The browser action to perform, such as navigate, click, type, extract, executeScript, wait, waitForSelector, screenshot, scroll, selectOption, getCurrentUrl, goBack, reload, or closeBrowser. |
| URL | The URL to navigate to (required for navigate action). |
| Selector CSS | CSS selector of the element to interact with (required for click, type, extract, waitForSelector, selectOption actions). |
| Texto | Text to type into an input field (required for type action). |
| Código JavaScript | JavaScript code to execute on the page (required for executeScript action). |
| Variable de Resultado | Name of the variable to store the result of the executed script (optional for executeScript action). |
| Tiempo (ms) | Time to wait in milliseconds (required for wait action). |
| Timeout del Elemento (ms) | Maximum time to wait for an element to appear in milliseconds (optional for waitForSelector action). |
| Dirección | Direction to scroll the page, either up or down (required for scroll action). |
| Valor | Value of the option to select in a dropdown (required for selectOption action). |
Output
JSON
action- The action performed.success- Indicates if the action was successful.result- Result data returned from the action, if any.sessionId- Session identifier for the browser session.executionTime- Timeout duration for the request.timestamp- Timestamp of the execution.
- Additional properties from the input JSON are preserved in the output.
Dependencies
- Requires a browser automation server accessible via the configured Server URL, which accepts HTTP POST requests with JSON commands.
Troubleshooting
- Ensure the browser automation server URL is correct and reachable.
- Verify the session ID is properly managed; for 'navigate' action a new session ID is generated if not provided.
- Check that CSS selectors are valid and elements exist on the page for actions requiring selectors.
- Timeout errors may occur if the server or page is slow; increase the request timeout or element timeout as needed.
- Errors returned from the server include an error message; review these messages to diagnose issues such as invalid commands or server errors.