Overview
This node automates browser actions using the Playwright library. It allows users to perform various web automation tasks such as navigating to URLs, extracting text from elements, clicking elements, filling form fields, taking screenshots, and running custom Playwright scripts. This is useful for scenarios like web scraping, automated testing, data extraction, or any workflow requiring interaction with web pages programmatically.
For example, you can use this node to:
- Navigate to a webpage and extract specific text content.
- Click a button on a page to trigger an action.
- Fill out and submit forms automatically.
- Capture screenshots of webpages for monitoring or documentation.
- Run custom Playwright scripts for advanced automation needs.
Properties
| Name | Meaning |
|---|---|
| Operation | The action to perform: Click Element, Fill Form, Get Text, Navigate, Run Playwright Script, or Take Screenshot. |
| URL | The web address to navigate to. Required for most operations. |
| Selector | CSS selector targeting the element to interact with (used in Get Text, Click Element, Fill Form). |
| Value | The value to fill into a form field (used in Fill Form operation). |
| Browser | The browser engine to use: Chromium, Firefox, or Webkit. |
| Browser Launch Options | Options for launching the browser: - Headless (boolean): run browser without UI. - Slow Motion (number): delay in ms between operations. |
| Playwright Script | Custom Playwright script code to execute (used in Run Playwright Script). |
| Property Name | Name of the binary property to store screenshot data (used in Take Screenshot). |
| Screenshot Options | Options for screenshots: - Full Page (boolean): capture entire scrollable page. - Path (string): file path to save the screenshot. |
Output
The node outputs an array with one item per input item processed. Each output item contains a json object with the result of the selected operation:
- For Get Text, the output JSON includes the extracted text content from the specified element.
- For Click Element and Fill Form, the output confirms the action was performed (usually empty or minimal JSON).
- For Navigate, the output confirms navigation success.
- For Take Screenshot, the output includes a binary property containing the screenshot image data under the user-defined property name.
- For Run Playwright Script, the output depends on the script's returned data.
If an error occurs and "Continue On Fail" is enabled, the output JSON will contain an error message along with the browser type and operating system platform.
Dependencies
- Requires the Playwright library installed.
- Downloads and manages browser executables automatically if not found locally.
- No explicit API keys or external services are required.
- Node.js environment must support dynamic imports and filesystem access for browser management.
Troubleshooting
- Browser executable not found: The node attempts to locate the browser executable; if missing, it triggers an automatic download. Ensure the environment has internet access and write permissions.
- Errors launching browser: Could be due to incompatible OS, missing dependencies, or corrupted browser installation. Check console logs for detailed errors.
- Selector not found: If the CSS selector does not match any element, operations like Get Text or Click Element will fail. Verify selectors carefully.
- Timeouts or slow responses: Use the "Slow Motion" option to slow down browser actions for debugging.
- Script errors in Run Playwright Script: Syntax or runtime errors in custom scripts will cause failures. Validate scripts before running.