Overview
This node allows you to automate browser actions using Playwright, a powerful browser automation library. It supports multiple operations such as navigating to URLs, clicking elements, filling forms, taking screenshots, extracting text, and running custom Playwright scripts. This flexibility makes it ideal for web scraping, automated testing, UI interaction automation, or any scenario where programmatic control of a browser is needed.
For example, you can use this node to:
- Navigate to a webpage and take a screenshot for visual verification.
- Extract text from specific page elements for data collection.
- Fill out and submit forms automatically.
- Run complex custom Playwright scripts to perform advanced interactions not covered by built-in operations.
Properties
| Name | Meaning |
|---|---|
| URL | The URL to navigate to before performing the operation. |
| Playwright Script | A custom Playwright script to run. The page object is available for scripting browser actions. |
| Browser | The browser engine to use: Chromium, Firefox, or Webkit. |
| Browser Launch Options | Options for launching the browser: - Headless: Whether to run the browser without UI. - Slow Motion: Delay in milliseconds to slow down operations for debugging. |
Output
The node outputs an array with one item per input item processed. Each output item contains a json field with the result of the performed operation. The exact structure depends on the operation:
- For navigation and simple actions, it may be confirmation or extracted data.
- For "Run Playwright Script", the output reflects whatever the custom script returns or modifies.
- If errors occur and "Continue On Fail" is enabled, the output includes an error message along with the browser type and operating system.
If the operation involves binary data (e.g., taking screenshots), the node stores the image data in a binary property named according to user configuration (not shown here but part of other operations).
Dependencies
- Requires the Playwright library installed in the environment.
- Downloads and installs browser binaries if not already present.
- Uses local filesystem paths to locate browser executables.
- No explicit external API keys or credentials are required for basic usage.
Troubleshooting
- Browser executable path errors: If the node cannot find the browser executable, it attempts to install the browser automatically. Ensure the environment has internet access and permissions to download and save files.
- Browser launch errors: These might occur due to incompatible environments, missing dependencies, or permission issues. Check logs for detailed error messages.
- Script errors: When running custom Playwright scripts, syntax or runtime errors in the script will cause failures. Validate scripts carefully.
- Continue On Fail: Enable this option to prevent the node from stopping execution on errors; instead, errors are returned in the output for handling downstream.