Playwright icon

Playwright

Control browser using Playwright directly with CDP URL

Wait For Load State

AI-generated

Overview

This node allows controlling a Chromium browser instance via the Chrome DevTools Protocol (CDP) using Playwright. Specifically, the "Wait For Load State" operation waits for the page to reach a specified loading state before proceeding. This is useful in automation workflows where subsequent actions depend on the page being fully loaded or reaching a certain readiness state.

Common scenarios include:

  • Waiting for a page to finish loading before scraping data.
  • Ensuring that all network requests have settled before interacting with page elements.
  • Synchronizing workflow steps with page load events to avoid timing issues.

For example, you might use this node to wait until the DOM content is loaded (domcontentloaded) before filling out a form or clicking a button.

Properties

Name Meaning
CDP URL Chrome DevTools Protocol WebSocket URL to connect to the browser instance.
State The load state to wait for before continuing. Options: Load (wait for full load event), DOM Content Loaded, Network Idle (no network connections for 500 ms).
Timeout (Ms) Maximum time in milliseconds to wait for the load state before timing out.

Output

The node outputs JSON data containing the performed operation name:

{
  "operation": "waitForLoadState"
}

No additional data is returned for this operation. The output confirms that the wait operation completed successfully.

Dependencies

  • Requires a running Chromium browser instance accessible via a Chrome DevTools Protocol WebSocket URL.
  • Uses the Playwright library to connect and control the browser.
  • The user must provide a valid CDP URL to connect to the browser.
  • No internal credential types are exposed; only the CDP URL string is required.

Troubleshooting

  • Unsupported load state error: If an invalid load state value is provided (not one of load, domcontentloaded, or networkidle), the node throws an error indicating unsupported load state. Ensure the "State" property is set correctly.
  • Timeout errors: If the page does not reach the specified load state within the given timeout, the operation will fail. Increase the "Timeout (Ms)" value if necessary.
  • Connection issues: If the CDP URL is incorrect or the browser is not reachable, the node will fail to connect. Verify the browser is running with remote debugging enabled and the URL is correct.
  • General operation errors: Any other unexpected errors during execution will be thrown as application errors. Check the browser status and parameters.

Links and References

Discussion