extract_semantic_dom
Navigate to a page and return semantic JSON of interactive elements with Playwright-native locators and live state, enabling accurate test selectors without guessing.
Instructions
Navigate to a staging URL and return factual Semantic JSON of all interactive/test-relevant elements with Playwright-native locators and live state. Use this before writing any Playwright test so selectors are real, not guessed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The page to extract. Must be http/https and on an allowlisted host. | |
| viewport | No | Viewport preset — 'mobile' is 375x812 with touch, for responsive states. | desktop |
| wait_for | No | Navigation wait condition. | networkidle |
| max_nodes | No | Cap on extracted nodes; truncation is flagged, never silent. | |
| wait_selector | No | Optional selector to await before extracting (for SPA content). | |
| include_hidden | No | Keep hidden nodes flagged rather than dropping them. | |
| include_click_targets | No | Opt-in heuristic: also include cursor:pointer elements with content that match no other rule (JS-click product cards without anchors/roles/test-ids). Heuristic nodes carry a context_note. |