Use await page.accessibility.snapshot() to inspect the accessibility tree Puppeteer receives from the page. The result is a serialized tree rooted at the page, or null; it is useful for checking accessible names, roles and states, but it is not a visual DOM dump or a guarantee of what every screen reader announces.
Take a page accessibility snapshot
After navigating to a page in Puppeteer, call and await page.accessibility.snapshot():
As an Amazon Associate I earn from qualifying purchases.
const snapshot = await page.accessibility.snapshot();
console.log(snapshot);
The promise resolves to a SerializedAXNode or null. Handle the null case before traversing the result. The current Puppeteer API reference documents this method and its options: Accessibility.snapshot().
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsChoose how much of the tree to include
The snapshot options control which nodes are retained and what part of the page is covered:
#1 Best Overall
| Option | Default | Effect |
|---|---|---|
interestingOnly |
true |
Prunes nodes Puppeteer considers uninteresting. Set to false to request a fuller tree. |
root |
Full page | Uses an ElementHandle<Node> as the snapshot root instead of the page. |
includeIframes |
false |
Includes accessibility trees for iframes in the frame subtree when enabled. |
Chrome’s accessibility tree can contain nodes unused by many platforms and screen readers, so Puppeteer prunes nodes by default. To inspect more of that tree and include iframe content:
const snapshot = await page.accessibility.snapshot({
interestingOnly: false,
includeIframes: true,
});
To narrow the capture to an element, obtain its handle and pass it as root. If TypeScript or editor diagnostics reject an option or handle type, check the type definitions for the Puppeteer version installed in the project.
Rank #2
- Core Functionality: This color test book provides a comprehensive and user-friendly color chart designed specifically for early detection of color deficiency, facilitating timely intervention and safer driving assessments
- Material and Design: Crafted from stable, lightweight, and durable materials, this test book offers convenience and longevity for repeated use in various settings
- Language and Accessibility: Designed in english to ensure easy understanding and accurate self-administration of the color test book by english-speaking users, enhancing usability and testing accuracy
- Portability and Storage: Compact dimensions of approximately 3.81 by 3.34 by 0.11 inches and lightweight construction make this test book highly portable and easy to store for use in clinics, schools, or at home
- Practical Application: Ideal for use in various scenarios such as driver screening, vision examinations, and color deficiency assessments, this color test book integrates multiple test charts to support thorough visual evaluations
Read and traverse the serialized result
A serialized accessibility node contains a role, a computed name, child nodes and other accessibility properties. Depending on the node, properties such as description, checked, disabled and busy may be present or absent. Treat those fields as optional rather than assuming every node has the same shape; the SerializedAXNode interface lists the documented fields.
For example, this traversal finds a node marked as focused and safely handles both a null snapshot and nodes without children:
function findFocusedNode(node) {
if (!node) return null;
if (node.focused) return node;
for (const child of node.children ?? []) {
const found = findFocusedNode(child);
if (found) return found;
}
return null;
}
const snapshot = await page.accessibility.snapshot();
const focusedNode = snapshot && findFocusedNode(snapshot);
console.log(focusedNode?.name);
A missing focused node is not evidence that the page has no focusable controls; it means this traversal did not find a node marked focused in this snapshot.
Use snapshots to inspect; use ARIA locators to act
A snapshot is best for examining the structured accessibility representation. If you want to click or fill a control by its computed accessible name and role, use Puppeteer’s locator API instead. Its ARIA selector resolves relationships such as labelledby before querying:
Rank #4
await page.locator('::-p-aria([name="Click me"][role="button"])').click();
For a control identified by its accessible name, the shorter form can be more convenient:
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteawait page.locator('::-p-aria(Search)').fill('automate beyond recorder');
Locators wait for action conditions such as visibility and enabled state, making them a better fit for interaction than extracting a snapshot and manually locating a node. See Puppeteer’s page interaction guide.
Best Value
Know what the snapshot does—and does not—represent
Puppeteer exposes Blink’s accessibility tree. As the Accessibility class documentation puts it, “Accessibility is a very platform-specific thing.” A browser’s tree is translated into platform APIs, and an operating system or assistive technology may filter it further. A Puppeteer snapshot therefore cannot establish exactly what every screen reader will announce. For user-facing accessibility testing, validate with the relevant browser, operating system and assistive technology as well.
Version considerations
The current API reference and guide consulted for this article identify Puppeteer 25.12.0. The changelog records an accessibility snapshot enhancement in version 24.37.0, dated February 4, 2026. APIs and serialized properties can change; use the documentation and type definitions matching the version installed in your project. The documented call shown here is page.accessibility.snapshot().
Or skip the browser setup
If your goal is a page screenshot rather than accessibility-tree inspection, ScreenshotNeo is a website screenshot API and MCP server for developers. A single GET request returns an image or PDF; for example, using cURL:
Free tools Windows power users keep installed
One-click scans. No signup required.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo documentation for API details. It accepts cookie or consent banners and removes known consent platforms, newsletter popups and chat widgets before capture; each step can be turned off. Bot checks, blank pages, timeouts, failed loads and cache hits cost nothing, and response headers report the page verdict and whether the shot was billed. Its MCP server lets AI agents use screenshot, page-info and PDF-capture tools. The free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Sign up for the free plan.
Frequently Asked Questions
Does a Puppeteer accessibility snapshot include iframes by default?
No. Set includeIframes: true to include accessibility trees for iframes in the frame subtree.
Can I use an accessibility snapshot as a complete screen-reader test?
No. It represents Blink’s accessibility tree; platform APIs and assistive technologies may transform or filter that information.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




