Skip to main content

Home › All stories

Accessibility tree or screenshots: how should a browser agent see the page?

The short answerStart a browser agent on the accessibility tree, a text outline of the page that is cheap and lets it act on exact elements. Add screenshots when the task depends on images, layout, charts or canvas. Use screenshots alone, with clicks by coordinates, only where no tree exists, such as desktop apps.

By · Published · Updated · 5 min read

A browser agent can see a page in two main ways: as text, through the accessibility tree or a cleaned copy of the DOM, or as an image, through screenshots. The choice decides how the model names its target, what each step costs, and which pages the agent can handle. The short answer is to start with the tree and add images where the page needs them.

What are the two ways an agent can see a page?

The two ways are a structured text view of the page's elements and a picture of the screen.

  • The accessibility tree. MDN explains that browsers turn markup into the DOM tree and then "create an accessibility tree based on the DOM tree, which is used by platform-specific Accessibility APIs to provide a representation that can be understood by assistive technologies, such as screen readers" (MDN, Accessibility tree, read 2026-11-26). Playwright's ARIA snapshots "provide a YAML representation of the accessibility tree of a page", for example - heading "Title" [level=1] (Playwright ARIA snapshots, read 2026-11-26).
  • Screenshots. The model receives an image of the viewport and names a target by pixel position, or by a label drawn on the image. Our guide to how computer use works covers the coordinate side.

How do the two compare?

They compare on cost, precision and coverage.

Table: Accessibility tree compared with screenshots for a browser agent

Accessibility treeScreenshots
What the model receivesText: roles, names, states, element referencesAn image of the viewport
How it names a targetAn element referencePixel coordinates, or a number from drawn marks
Model neededAny text modelA model that reads images
Precision of the actionExact elementDepends on grounding and coordinate scaling
Images, charts, canvas, visual layoutOnly what labels and alt text sayVisible
Pages with poor labelsWeakUnaffected
Very large pagesThe text can get longOne image per viewport
Desktop apps outside the browserOnly where an accessibility API exposes themWorks on any screen

What does the research say?

The research says each view wins on different tasks, and that the visual side has improved since the first benchmarks.

Table: Published results by observation type

StudySettingText viewWith imagesSource
OSWorld (2024)Desktop tasks, best result per settingAccessibility tree alone: 12.24%Screenshot alone: 5.80%; screenshot with tree: 12.17%; set-of-marks: 11.77%arXiv 2404.07972
VisualWebArena (2024)910 visually grounded web tasks, best modelText only: 7.25%; with image captions: 12.75%Screenshot and tree: 15.05%; set-of-marks: 16.37%arXiv 2401.13649
WebVoyager (2024)643 tasks on 15 live websitesAccessibility tree baselineScreenshot with marks beat it on most sites; similar or lower on text-heavy sitesarXiv 2401.13919

All read 2026-11-26. Three points from the papers explain the numbers.

  1. Text wins when the page is mostly text and labels. The OSWorld authors wrote that "The setting that relies solely on screenshots exhibits the lowest performance". WebVoyager's screenshot agent did slightly worse than, or about as well as, the text-only agent on five of its 15 sites, which the authors put down to those sites being "more text-heavy than others": "dense text might not be easily recognizable from the image".
  2. Images win when the page is visual. The VisualWebArena authors found that on dense pages "the accessibility tree does not provide sufficient information to disentangle elements that are spatially close", and that set-of-marks helped most on the visually crowded sites.
  3. Screenshot-only agents have improved. A January 2025 paper on a model that "solely perceives the screenshots as input" reported 24.6 on OSWorld with 50 steps (arXiv 2501.12326, read 2026-11-26), about twice the 2024 text-view baseline. Compare models on the version of the benchmark you care about, not on these older figures.

What does each view cost in tokens?

Each view costs tokens in a different way: the tree grows with the page's content, a screenshot grows with its pixel size.

  • Tree. The OSWorld authors note that the raw accessibility tree in XML "contains millions of tokens", that they filtered it, and that "a context length of 6000 is needed to accommodate about 90% of cases for a single observation" (OSWorld paper, read 2026-11-26). Trimming the tree to visible, interactive elements is what makes it cheap.
  • Screenshot. Chrome DevTools MCP's configuration guide advises resizing rather than compressing, "since image tokens scale with dimensions rather than encoded bytes" (Chrome DevTools MCP configuration, read 2026-11-26).

Which view do the common browser tools use by default?

The common open-source browser servers for agents use the accessibility tree by default and offer screenshots as a second view.

  • Playwright MCP says it "Uses Playwright's accessibility tree, not pixel-based input" and needs "No vision models". Its snapshot tool is described as "better than screenshot", and the coordinate mouse tools are opt-in with --caps=vision (Playwright MCP README, read 2026-11-26). Its --snapshot-boxes option adds each element's bounding box to the snapshot, which helps a hybrid agent match text and image.
  • Chrome DevTools MCP's snapshot tool says "Prefer taking a snapshot over taking a screenshot", and its click_at tool needs --experimentalVision=true (Chrome DevTools MCP tool reference, read 2026-11-26).

See what Playwright MCP is and what Chrome DevTools MCP is for setup.

How do I choose for my agent?

Choose by checking what your target pages need, in this order.

  1. Start with the accessibility tree for forms, tables, links, menus and text. It is cheap, works with any model, and the action lands on an exact element.
  2. Check the tree on your real pages. Open a snapshot of each key page. If important buttons have no names, or the content is a canvas, a map, a chart or a grid of images, the tree will not carry it.
  3. Add a screenshot to the tree for those pages, so the model sees the layout but still acts by element reference.
  4. Use set-of-marks when the model must pick among many similar visual items, such as product images.
  5. Use screenshots alone with coordinates only where no tree exists: desktop applications, remote desktops, or pages that render everything into a canvas.
  6. Measure on your own tasks. Run the same task set with each view and compare success, steps and tokens per task.

What we read for this article

Frequently asked

What is the accessibility tree?

It is the browser's outline of a page for assistive technology, built from the DOM, with each element's role, name and state. MDN describes it as containing accessibility-related information for most HTML elements.

Are screenshots better than the accessibility tree for web agents?

It depends on the page. In VisualWebArena, whose tasks need visual understanding, adding screenshots raised the best success rate from 7.25% (text only) to 15.05%. In OSWorld's 2024 baselines the accessibility tree alone scored 12.24% and screenshots alone 5.80%.

What is set-of-marks prompting?

It is drawing a numbered box on each clickable element of a screenshot, so the model can answer with a number instead of coordinates. VisualWebArena and WebVoyager both used it for their browser agents.

Which one do Playwright MCP and Chrome DevTools MCP use?

Both default to an accessibility-tree snapshot and describe it as preferred over screenshots. Both can add clicks by coordinates as an opt-in feature.