--axtree
Write an accessibility tree alongside another output, the way --har
captures a HAR. Takes a path:
zshot --output-type png --axtree page.json https://zshot-cli.com -f page.pngThe form follows the path extension: .json (the default — the structured tree with bounding boxes),
.txt or .text for the indented snapshot, anything else JSON. To emit a tree as the primary output
on its own, use --output-type axtree (text) or --output-type axtree_json.
Because a tree is a per-page snapshot, rendering multiple URLs writes one tree per render, sequenced
like the primary output: page.json becomes page-1.json, page-2.json. This differs from
--har/--warc, which share a single file across the batch.
When the primary output is timed (a video or animated image), the tree is captured after recording finishes, so it reflects the last frame. zshot prints a warning to that effect so the captured moment is never a surprise.
On the HTTP server, request this as with_axtree=<true|json|text> — true or json for the JSON
tree, text for the snapshot. The server writes the tree to a temporary location and returns its URL in a
Link response header. See the API reference for reading those links and
--server-additional-asset-expiration
for how long they live.