Playwright Automation icon

Playwright Automation

Playwright Automation for n8n

Page → Count Elements

AI-generated

Summary

Count elements matching a CSS or XPath selector on the current page.

Inputs

  • sessionId (required) — The ID of an active Playwright session.
  • selector (required) — CSS or XPath selector to match elements.

Output shape

object

Returned upon success. The count field specifies the number of matching elements.

Examples

Example 1: Count all visible buttons on the page

sessionId: existing-session, selector: button:visible

Links

Discussion