page_snapshot
Capture a lightweight snapshot of the current page, including route, query, data paths, and key selector elements. Use it to probe the DOM and state when page content is unknown.
Instructions
返回当前页面的轻量结构快照,聚合 route、query、指定 data 路径、关键选择器的元素摘要。最适合「不确定页面上有什么」时探查 DOM/状态(page_waitElement 超时排查也会指向它)。返回 {route,query,selectors,elementCount,elementsLimited,processedSelectorCount,elementSummaryLimit,elements:[{selector,index,tagName,text,value,size,offset}],data?,hint?}。⚠️ 不传 selectors/dataPaths/withData 时只返回 route——这不代表页面为空,会附 hint 提示补参。withData=true 会把整棵 data 树塞进 data['$'](token 炸弹,大对象改用 dataPaths 按字段投影)。limit 默认 10,限制每个 selector 返回的元素数;所有 selector 合计最多汇总 100 个元素摘要,达到上限时 elementsLimited=true。整个快照超过 maxBytes(默认 50000B)返回 truncated 包装。单个已知字段用 page_getData,单个元素用 page_getElement。对自定义组件同样默认不穿透(取决于 styleIsolation/addGlobalClass)。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| maxBytes | No | ||
| withData | No | ||
| withWxml | No | ||
| dataPaths | No | ||
| selectors | No | ||
| connection | No | 可选连接覆盖(不传则用默认会话)。可用字段:mode(launch|connect)、cliPath、projectPath、wsEndpoint、timeout、port(【自动化端口】→ cli auto --auto-port,默认 9420;不是 IDE HTTP 服务端口,别把 IDE 服务端口传进来)、account、ticket、trustProject、args、cwd、autoClose、autoLaunch、launchTimeout、connectTimeout。 | |
| withElements | No |