Playwright icon

Playwright

Automate browser tasks with Playwright and optional CDP connection

Browser → Screenshot

AI-generated

Summary

Capture a screenshot of a webpage using a Playwright browser session, with options to launch a new browser or connect via CDP, specify page navigation URL, control screenshot scope, and manage browser/tab lifecycle after execution.

Inputs

  • Connection Mode (required) — Choose whether to launch a new browser or connect over Chrome DevTools Protocol (CDP).
  • Browser Type (required) — Select browser type when launching (Chromium, Firefox, WebKit). Shown only when launching.
  • Headless (required) — Run browser in headless mode (no visible UI) when launching.
  • CDP Endpoint (required) — URL for CDP connection endpoint. Required when connecting via CDP.
  • Use Existing Tab (required) — Reuse an existing tab in connected browser (CDP mode only).
  • Tab Index (required) — Specify which tab index to reuse when reusing an existing tab.
  • Timeout (MS) (required) — Maximum wait time for browser actions in milliseconds.
  • Session ID — Identifier to reuse the same browser session and page across nodes.
  • Block Resource Types — Resource types to block loading to reduce bandwidth, applied on new page creation only.
  • Block URL Patterns — Comma-separated URL glob patterns to block requests, applied on new page creation only.
  • Additional Data — Optional JSON data to include in the output.
  • Target URL — URL to navigate to before capturing the screenshot.
  • Full Page (required) — Capture the entire scrollable page if true; otherwise capture only the viewport.
  • Binary Property (required) — Name of the output binary property that will contain the screenshot data.
  • File Name (required) — File name for the screenshot output.
  • After Execution (required) — Specify whether to close the browser, close just the tab/page, or keep both open after operation completes.

Output shape

A list of items each containing JSON metadata and a binary attachment with the screenshot image.

Each output item includes JSON fields such as operation name, connection mode, session ID, tab index, timestamp, optional additional data, file name, binary property name, and success flag. The screenshot is returned as a binary data buffer under the specified binary property name, in PNG format. The node supports multiple input items, producing corresponding screenshot outputs. Proper browser or page/tab closure is handled based on the After Execution setting.

Examples

Example 1: Take a full-page screenshot of 'https://example\.com' using a launched Chromium browser in headless mode, closing the browser after capturing.

Connection Mode = Launch Browser; Browser Type = Chromium; Headless = true; Target URL = https://example.com; Full Page = true; File Name = screenshot.png; After Execution = Close Browser

Links

Discussion