Core Concepts
Snapshots
Snapshots return cleaned HTML with `c` counters for page exploration and extraction planning.
Snapshots
snapshot() gives you a cleaned HTML view of the current page. It is designed for exploration, not for pixel-perfect rendering.
Two modes
| Mode | Use it for |
|---|---|
action | Clicking, hovering, typing, and scrolling |
extraction | Reading page content and building extraction schemas |
SDK:
const actionHtml = await opensteer.snapshot("action");
const extractionHtml = await opensteer.snapshot("extraction");
CLI:
opensteer snapshot action --workspace demo
opensteer snapshot extraction --workspace demo
What the output looks like
Each visible target is annotated with a c counter:
<main c="1">
<h1 c="2">Example Domain</h1>
<p c="3">This domain is for use in illustrative examples.</p>
<a c="4" href="https://www.iana.org/domains/example">More information...</a>
</main>
You use those counters for SDK element targets and CLI positional element arguments:
await opensteer.click({ element: 4 });
opensteer click 4 --workspace demo
Important rule
Counters are only valid for the current page state.
Always re-snapshot after:
- navigation
- opening a new page
- form submission
- any action that changes the DOM enough to move elements around
What snapshot() returns
The high-level SDK returns the HTML string only.
It does not return the full internal snapshot object. If you need a visual image, use computerExecute({ action: { type: "screenshot" } }).
