get_page_elements
Extract elements from a webpage by CSS selector, returning tag, text, id, class, href, and other attributes. Supports optional full text and extra HTML attributes for detailed inspection.
Instructions
List elements matching a CSS selector with their attributes (tag, text, id, class, href, value, visible, enabled, aria_label, role). Pass 'attributes' for extra HTML attributes (data-, aria-, style, ...) and 'full_text' for complete text content instead of the 80-char preview. Works on a session or a URL. Standard CSS selectors only — Playwright-specific pseudo-classes (:has-text, :visible) are not supported here.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | URL to open (use this or session_id) | |
| project | No | Project name (optional). With a project: runs in its shared, authenticated context. Without: runs in an isolated context (no shared cookies/login). | |
| selector | Yes | CSS selector to match elements | |
| full_text | No | Return full text content instead of an 80-char preview (default: false) | |
| attributes | No | Extra HTML attribute values to include per element (e.g. data-testid, aria-expanded, style) | |
| session_id | No | Session ID (use this or url) | |
| max_results | No | Max elements to return (default: 50) |