HTML Table Extractor: tables to rows, CSV and JSON avatar

HTML Table Extractor: tables to rows, CSV and JSON

Pricing

from $1.40 / 1,000 table extracteds

Go to Apify Store
HTML Table Extractor: tables to rows, CSV and JSON

HTML Table Extractor: tables to rows, CSV and JSON

Extracts every HTML table from the pages you list into rows keyed by column header, lining up colspan and rowspan cells and joining stacked headers, and saves each table as a CSV file and a JSON file.

Pricing

from $1.40 / 1,000 table extracteds

Rating

0.0

(0)

Developer

Ed Rayyis

Ed Rayyis

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

4 days ago

Last modified

Share

Give it a list of page URLs, or paste HTML, and it returns every table on each page as rows keyed by column name. Each table is also saved as a CSV file and a JSON file you can download straight away.

What it handles

  • colspan and rowspan. Every table is laid out on a full grid. A merged cell fills each position it covers, so values stay in the right column and a cell that spans two rows appears in both.
  • Stacked headers. When a header has two or more rows, the names are joined per column: a "Revenue" cell over "USD" and "EUR" gives the columns Revenue / USD and Revenue / EUR. Repeated names get a number, such as Total_2.
  • Header detection. It uses the thead rows, or the leading rows made only of th cells. You can force the first row as the header, or use no header at all.
  • Footnote marks. Superscript marks such as [1] or [a] are removed from cell text by default.
  • Line breaks and nested tables. A line break inside a cell becomes a space. A table inside a cell is returned as its own table, and the outer cell keeps its own text.
  • Context. Each table comes with its caption and the nearest heading above it.
  • Filters. Skip tables below a minimum number of data rows or columns (2 and 2 by default), keep only tables whose caption, heading or column names contain a word, and cap the tables per page. Tables marked role="presentation" are skipped.
  • Numbers. Optionally, cells holding only a number (such as 1,200 or 35.5) become numbers in the JSON rows.

Input

  • Page URLs, pasted HTML, or both
  • Header rows: detect (default), first row, or none
  • Minimum data rows (default 2) and minimum columns (default 2)
  • Only tables mentioning (optional text)
  • Maximum tables per page (default 50)
  • Remove footnote marks (default on), turn number cells into numbers (default off)
  • One dataset item per row (default off), include Markdown (default off)
  • Pages at once (default 5) and page timeout (default 30 seconds)

Output

Dataset: one item per table with url, tableIndex (its position among the tables on the page), caption, heading, columns, rowCount, columnCount, headerRowCount, rows (one object per row, keyed by column name), and csvUrl and jsonUrl links to the files. With "One dataset item per row" on, each row is its own item with rowIndex and row, which exports cleanly to CSV or Excel.

Key value store: for every table, table-<page>-<table>.csv (header row first, the text as shown on the page) and table-<page>-<table>.json (the same fields as the dataset item). Pasted HTML is page 0000.

A page that cannot be read, or has no table that meets the filters, returns an item with ok: false and the reason, such as HTTP 404 or no tables on the page. The rest of the run carries on.

Pricing

Pay per event: one event per table extracted. Pages with no tables and pages that fail are not charged. The run stops when it reaches the maximum charge you set.

Scope and conduct

Only the HTML of each URL you list is downloaded. Tables built by scripts after the page loads are not seen. Links are not followed. No login is used.

Support

Questions and problems: the Issues tab on this page. Replies are written by an AI assistant on behalf of the developer and reviewed by the developer.