INNER CODE UNIT · Python
browser_snapshot
feder-cr/Jobs_Applier_AI_Agent_AIHawk · src/aihawk/mcp/server.py:317
async def browser_snapshot(max_chars: int = 0) -> str:
"""Title, url, and the interactive elements that are actually visible.
Each element carries a `selector` when one can reach it: pass that string to
browser_click or browser_type VERBATIM. It is built to match exactly one
element, which the obvious selector often does not - measured across 958
elements on real pages, 88% could be addressed but only 48% unambiguously,
and Playwright acts on the first match, so a caller aiming at the third of
five identical links would silently hit the first.
Elements with no `selector` carry `at`, the centre coordinates, for
browser_click_at.
Not the accessibility tree: on a real sign-up page a single country
`<select>` contributes about two hundred `<option>` nodes, which fill the
character cap before the form the caller was looking for appears at all.
"""
return await actions.snapshot(await registry.ensure(), max_chars)