Repository navigation
reading a table with an ai agent
A table is the one page element where the structure is the meaning. Read it as text and you get the numbers in reading order with nothing saying which column each belonged to, which for anything wider than two columns is not recoverable.
So the first decision is which read to ask for, and it is not the cheapest one.
browser_read_html keeps cells as cells and rows as rows. On a small page it
costs about 1.3 times the plain text; on a long one it was the largest text
payload of the four reads, because it does not truncate where the text read does.
Both measurements are on
text, HTML, snapshot or screenshot.
That matters here more than elsewhere, because tables are exactly the pages that get long. A four-hundred-row table in markup is a lot of context, and the way out is to scope the read to the table rather than the page, not to switch to a cheaper read that destroys the structure.
Three ways a cell lies, all common in real tables:
-
Rounding.
1.2M,12.3%,3.4k. The exact figure is frequently in a title or a data attribute on the cell, and the text read cannot see either. -
Formatting. Thousands separators and decimal marks differ by locale, so
1.234is one number in one country and another elsewhere. Record what the page showed as well as what you parsed, which is the two-column rule in normalising values across sites. - Sorting by a hidden key. A column of dates displayed as "3 days ago" sorts on a timestamp that only exists in an attribute.
All three are reasons the markup is the right ask rather than a preference.
Simple tables have one header row. Real ones do not:
- Spanning headers, where one cell covers three columns and a second row names them. The column a value belongs to is the pair, and a naive read takes the nearest.
- Row headers, where the first cell of each row is a label rather than data. Treating it as a value shifts the whole row by one.
- Repeated headers every twenty rows, on long tables, which then appear as data rows containing the word "Price".
- Layout tables, where a table element is used for arrangement and there is no data in it at all.
Tell the agent which shape it is looking at if you know, and have it report the header row it decided on. A run that states "columns: Item, Price, Stock" is one you can check in a second; a run that returns rows is one you cannot.
Totals, subtotals, section separators, "no results" placeholders and expandable detail rows all arrive as rows. A sum over a column that includes the total row is double the truth, and it looks plausible.
Two instructions handle it: say what a data row looks like (for instance, one whose first cell is a product code), and have the agent report how many rows it rejected and why. The second number is the one that shows a filter that was too aggressive.
Three different problems that look identical on the first screen, and each has its own fix. They are the same three as in getting data out of a dashboard with no export button, which is the sibling page for the case where the table is in an internal tool.
The trap specific to tables: a virtualised table destroys rows as you scroll past them, so the agent must accumulate as it goes and deduplicate on a key rather than on position. That is its own page.
Tables usually state their own size, in a caption, a counter, or a pagination control. Compare it against the number of rows you got, and compare a column sum against a total the table prints if it has one.
A row count that matches and a sum that does not usually means a rounded display value read as exact, which is the first failure on this page arriving at the end of it.
How does an AI agent read a table? Ask for the HTML rather than the text: the text read loses which column a value belonged to. Scope the read to the table on a long page.
Why are my columns shifted? Usually a row header treated as data, or a spanning header row that put values under the wrong name.
Why do my numbers not add up? Either a total row counted as data, or a rounded display value where the exact one sits in a cell attribute.
Why did I only get twenty rows? Pagination, scrolling or virtualisation. Check for a next control before assuming the table is short.
Should I screenshot the table? No. The structure is the content, and a picture of a table is the one representation that keeps none of it.
See also: getting data out of a dashboard with no export button for tables inside internal tools, and validating an AI agent's output for the counts that catch a partial read.
- The relative cost of the four reads, including that HTML is 1.3x the text on a small page and the largest payload on a long one, is measured and sourced on text, HTML, snapshot or screenshot.
- The table failure modes are from reading real tables with this browser and are offered as experience rather than as a study. No site is named.
Ask for the markup and scope it to the table. Most of the rest of this page is what happens to people who asked for the text because it was cheaper.
- OpenAI Operator alternatives
- Open-source Operator-style agents
- Is OpenAI Operator still available?
- OpenAI Operator vs Claude computer use
- browser-use alternatives
- Choosing an AI browser agent
- Open-source AI browser agents
- Open-source computer-use agents
- What is an AI web agent?
- AI browser agents vs traditional scraping
- Cloud browser infrastructure for AI agents, explained
- Browserbase alternatives
- Firecrawl vs an AI browser agent
- Skyvern alternatives
- Stagehand vs browser-use
- Project Mariner is gone: what replaced it
- Manus alternatives
- Gemini computer use vs Claude computer use
- A stealth browser MCP, reviewed honestly by its own wiki
- AI browser vs AI browser agent: which one do you want?
- AI browser agent vs RPA: which one fits the job
- AI browser agent vs n8n, Zapier and Make
- Vercel agent-browser alternatives, compared honestly
- What is an agentic browser? Definition and the two kinds
- Open-source agentic browsers: the three layers, compared
- Choosing an MCP server for browser automation: four axes
- Stealth MCP servers compared: Camoufox, nodriver, Patchright
- Playwright MCP alternatives, and the three you don't need
- Autonomous browser agents: the four rungs of autonomy
- What is actually free in the AI browser agent stack
- browser-use on GitHub: what the repo actually gives you
- Playwright MCP vs Chrome DevTools MCP: different jobs
- How to choose among MCP servers: a map by category
- Which MCP servers are worth adding to Claude Code
- MCP on GitHub: finding servers and judging them fast
- MCP vs an API: the decision, and what the wrapper costs
- MCP alternatives: when the protocol is the wrong shape
- Why does my AI agent get blocked?
- The timing signal AI agents give off
- Agent retry loops trip rate limits, not fingerprints
- Claude computer use detected as a bot
- browser-use getting blocked: what you can and cannot change
- Playwright MCP session blocked: four causes, four fixes
- Playwright MCP and captchas: what actually gets you past
- Cloudflare and a browser MCP server: what is being read
- Can an AI agent solve a captcha? The honest answer
- Getting an AI agent to fill out forms
- The best model for an MCP browser agent, and what it really costs
- Browser problem or model problem?
- How to use a Playwright MCP server with Claude Code
- Extracting data to a CSV with an AI agent
- Monitoring a page for changes with an AI agent
- How to let Claude Desktop control a browser
- How to add a browser to Cursor as an MCP server
- Using an AI agent to hunt for apartments
- Getting website data into Google Sheets with an AI agent
- Using an AI agent to download invoices from portals
- AI agents for web research
- Using an AI agent to test your own website
- How to add a browser to Cline as an MCP server
- Posting to social media with an AI agent
- Posting to Facebook with an AI agent
- Posting to Instagram with an AI agent
- Posting to X with an AI agent
- Automating LinkedIn posts: read this first
- Appointment bots: what they are and what an agent can legitimately do
- Track prices across sites with an AI agent
- Build a lead list with an AI browser agent
- Run an AI browser agent on a schedule
- AI browser agent with a local LLM: what changes
- Should you log your AI agent into your accounts?
- How to write a task an AI browser agent can follow
- Move data between two web apps with an AI agent
- The MCP server
- How the tools are shaped, and why
- Playwright MCP vs the Playwright CLI: which fits when
- Playwright MCP: browser is already in use, and the fix
- Playwright MCP best practices: four decisions that matter
- Playwright MCP with a proxy, and the three leaks it leaves
- A browser MCP server in GitHub Copilot: setup and limits
- Using a browser MCP server for web scraping: the pattern
- Which LLM for browser automation: the four properties
- How to build a browser agent, and what to take instead
- Getting an AI agent to log into a website: three routes
- MCP tools, resources and prompts: who controls each
- How many MCP tools is too many? The context arithmetic
- How to build an MCP server: the decisions, not the scaffold
- Local or remote MCP server: what changes, and what does not
- Writing an MCP client in Python: the thirty-line version
- Self-hosted AI agent: what one actually costs to run
- How long an AI browser agent takes per step, measured
- Text, HTML, snapshot or screenshot: what the agent should read
- Giving an AI browser agent a stopping condition
- Keeping an AI browser agent out of destructive actions
- Why did the AI agent click the wrong thing
- When the page changes under the AI agent
- Running one AI agent task across a list of sites
- Seeing a page as it appears in another country
- Getting data out of a dashboard with no export button
- Two browsers in one session: main and support
- Finding the dead links on a site with an AI agent
- Filling a CRM record from a company's website
- One form submission per spreadsheet row, with an AI agent
- Dated screenshots of a page as evidence
- Checking order and delivery status with an AI agent
- Reading a PDF that opens inside the browser
- Summarising a long page or thread with an AI agent
- Collecting every image on a page with its caption
- Collecting event and course listings with an AI agent
- Cancelling a subscription with an AI agent
- What an AI agent can and cannot do inside an iframe
- Shadow DOM and an AI agent: you can click it, you cannot read it
- How to add a browser to Codex as an MCP server
- What a page snapshot costs, per control
- How to let Gemini CLI use a browser
- Native selects and the ones that only look like selects
- Clicking by selector or by coordinates
- How long the agent waits before it gives up
- What a second browser costs
- Uploading a file with an AI agent, and why this one cannot
- Watching the agent work, and when it is worth it
- When not to use an AI browser agent
- Agent or script: deciding once instead of every time
- Using the keyboard instead of the mouse
- Secrets in an agent task: where they end up
- What an agent run should log
- Deduplicating what an AI agent collects
- Normalising values across sites
- Validating an AI agent's output
- Reading a table with an AI agent
- Driving a site's own search and filters
- The task works headed and fails headless
- How to let the AdaL CLI use a browser