HTML Table Extractor avatar

HTML Table Extractor

Pricing

from $3.00 / 1,000 results

Go to Apify Store
HTML Table Extractor

HTML Table Extractor

Extract every table from any web page into clean rows, JSON and markdown. Correctly handles colspan, rowspan and stacked headers that break other extractors.

Pricing

from $3.00 / 1,000 results

Rating

0.0

(0)

Developer

Neil Sangwaiya

Neil Sangwaiya

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Share

Pull every data table from any web page into clean rows, as JSON, CSV or markdown.

Why tables break other extractors

Tables look simple and are not. Four things go wrong, and all four are handled here.

colspan and rowspan silently misalign everything. A cell spanning two rows shifts every later cell one column to the left, so row three onward quietly contains the wrong values. Nothing errors, the data is just wrong. This Actor expands spans into a proper rectangular grid, repeating spanned values so every row stands alone.

Stacked headers lose their meaning. Tables with grouped columns have two or three header rows, and taking only the first gives you a bare Revenue with no idea which year. This Actor joins them: 2025 / Revenue.

Navigation and layout tables come through as data. Wikipedia navboxes, infoboxes and sidebars are structurally identical to data tables. This Actor filters them by class, by role="presentation", and by link density, since a table that is more than 80% link text is a menu, not data. On one Wikipedia page that reduced six "tables" to the two that were real.

CSS ends up inside your cells. A <style> tag inside a table is picked up by naive text extraction, so cells fill with .mw-parser-output .navbar{display:inline...}. Removed here, along with footnote markers like [1].

What you get

FieldDescription
urlSource page
tableIndexPosition of the table on the page
captionTable caption, or the nearest heading above it
headersColumn names, with stacked headers joined
rowsArray of objects keyed by column name
rowCount / columnCountTable dimensions
markdownThe table rendered as markdown, ready to feed an LLM
scrapedAtISO timestamp

Set One record per row to flatten the output so it exports straight to CSV or a spreadsheet.

Example input

{
"urls": ["https://en.wikipedia.org/wiki/List_of_largest_companies_by_revenue"],
"minRows": 3,
"rowRecords": false
}

Options

  • Minimum rows and Minimum columns — filter out small layout tables
  • One record per row — flatten for CSV export
  • Include markdown — a markdown rendering per table, useful for RAG, since plain-text extraction turns tables into unusable word salad
  • Max tables per page — cap for pages with very many tables

Notes

  • Reads the HTML the server returns. Tables rendered entirely by JavaScript after load will not appear.
  • Nested tables are skipped rather than flattened into their parent cell.