Actions10
Wait For Selector
AI-generatedOverview
This node allows you to control a Chromium-based browser using the Playwright library by connecting directly via a Chrome DevTools Protocol (CDP) URL. It supports various browser automation operations such as clicking elements, filling inputs, navigating to URLs, taking screenshots, waiting for selectors or page load states, typing text, pressing keys, and waiting for timeouts.
Common scenarios include automated web testing, scraping data from websites, automating form submissions, capturing screenshots of pages, and synchronizing workflows with page events.
For example, you can use this node to:
- Wait for a specific button to appear on a page before clicking it.
- Navigate to a webpage and take a full-page screenshot.
- Fill out and submit a form automatically.
- Pause workflow execution until the page finishes loading.
Properties
| Name | Meaning |
|---|---|
| CDP URL | Chrome DevTools Protocol URL to connect to the browser (e.g., ws://localhost:9222/...). |
| Selector | Playwright selector string to identify an element on the page (e.g., css=button#submit). |
| Timeout (Ms) | Maximum time in milliseconds to wait for the selector to appear or for the page to load. |
Note: The above properties are relevant when the operation is "Wait For Selector". The node also supports other operations with additional properties not listed here.
Output
The node outputs JSON objects indicating the performed operation. For most operations, the output JSON contains:
{
"operation": "<operation_name>"
}
For the "Screenshot" operation, the node outputs binary data containing the captured image under the key screenshot along with the JSON metadata:
binary.screenshot: The screenshot image file in JPEG format.json.operation: The name of the operation performed ("screenshot").
Dependencies
- Requires a running Chromium browser instance accessible via a Chrome DevTools Protocol WebSocket URL.
- Uses the Playwright library to interact with the browser.
- No internal credential names are exposed; users must provide a valid CDP URL to connect.
Troubleshooting
- Connection issues: Ensure the provided CDP URL is correct and that the Chromium browser is running with remote debugging enabled.
- Timeout errors: If waiting for a selector or load state times out, verify the selector is correct and the page is loading as expected within the specified timeout.
- Unsupported operations: Using an unsupported operation value will throw an error indicating the operation is not supported.
- Invalid load state: Specifying an invalid load state for waiting will result in an error mentioning the unsupported load state.