Actions15
- Session Actions
- Page Actions
- Script Actions
Page → Count Elements
AI-generatedSummary
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
countfield specifies the number of matching elements.
Examples
Example 1: Count all visible buttons on the page
sessionId: existing-session, selector: button:visible