HTML Table Extractor: Web Tables to CSV, JSON, Excel avatar

HTML Table Extractor: Web Tables to CSV, JSON, Excel

Pricing

from $0.47 / 1,000 extracted tables

Go to Apify Store
HTML Table Extractor: Web Tables to CSV, JSON, Excel

HTML Table Extractor: Web Tables to CSV, JSON, Excel

Extract HTML tables from web pages or raw HTML into JSON rows keyed by header, with optional CSV and Excel files: colspan/rowspan, header detection, number cleanup, robots.txt respected. Empty input = free demo. Failed pages are free.

Pricing

from $0.47 / 1,000 extracted tables

Rating

0.0

(0)

Developer

Actor Factory

Actor Factory

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

6 days ago

Last modified

Features

Limited permissions

Share

Turns the tables on web pages into clean rows (and CSV or Excel files), one dataset row per table row. Built for analysts, researchers and developers who need the data from an HTML table (a Wikipedia list, a price page, a standings table, a report) in a spreadsheet or a database, and are tired of copy-pasting, broken merged cells and header rows that come out as data. Plain HTTP, no browser, no login, no API key.

Try it free: leave input empty and press Start. The demo extracts two tables from a bundled sample page (one with a two-row header and merged cells) and is not charged (rows carry _demo: true).

RegionRevenue Q1Revenue Q2_sourceUrl_tableIndex_rowIndex
North$1,200.50$1,450.00https://example.com/sample-report00
South$980.00$1,010.25https://example.com/sample-report01

What you get

  • One dataset row per table row, keyed by the column header, plus _sourceUrl, _tableIndex and _rowIndex (all 0-based; the header row is not counted)
  • Header detection: thead or leading th rows; multi-row headers are merged (Revenue Q1); empty names become column_N, duplicates get a _2 suffix; or force first-row / no header
  • colspan and rowspan expanded, so every row is complete (the merged value is repeated, or left empty if you prefer)
  • Number cleanup (optional): $1,234.50 becomes 1234.5, 12% becomes 12, (5) becomes -5; text, dates and IDs with leading zeros stay as they are
  • Pick tables: CSS selector (table.wikitable, #prices), table indexes, minimum row count, maximum tables per page
  • CSV and Excel files (optional): one file per table in the key-value store; the TABLES record lists the keys, columns and row counts
  • Inputs: page URLs, raw HTML strings, or both in one run
  • Footnote marks such as [1] on Wikipedia are dropped from cell text

Polite by design

Only the URLs you give are fetched (no crawling, no login, no JavaScript, no proxy tricks). robots.txt is respected by default (disallowed pages are skipped and free). One request at a time per host, at least 1 second apart, retries with backoff (1, 2, 4 seconds, or the server's Retry-After) for timeouts, 429 and 502/503/504. The User-Agent identifies a generic bot. Internal and private addresses are refused. Pages over 5 MB are refused.

Price

$0.0067 per run with results, plus $0.67 per 1,000 tables ($0.00067 per table extracted, whatever its number of rows). One run with 1 table costs $0.00737; a run with 1,000 tables costs $0.6767. The run fee is charged once, together with the first extracted table. Failed fetches, pages blocked by robots.txt, pages without tables and the demo are free, and a run where nothing is extracted costs nothing. Set a maximum cost per run to cap spend: when it is reached the run stops cleanly (status Succeeded) and STATS says so (stoppedAtChargeLimit: true).

Input

FieldWhat it does
urlsPage URLs with tables
htmlStrings, baseUrlRaw HTML (and the label written to _sourceUrl)
tableSelector, tableIndexesWhich tables to keep
minRows, maxTablesPerPageSkip tiny tables; cap tables (and cost) per page
headerModeauto, first_row, none
fillSpansRepeat merged cells (default on)
numericCleanupConvert numbers (default off)
saveCsv, saveXlsxSave each table as a file
respectRobotsTxtDefault on
maxRetries, timeoutSecs, concurrency, userAgentFetching options

Example input:

{
"urls": ["https://en.wikipedia.org/wiki/List_of_countries_and_dependencies_by_population"],
"tableSelector": "table.wikitable",
"maxTablesPerPage": 1,
"numericCleanup": true,
"saveCsv": true
}

Output

Dataset: one item per table row, for example

{"Region": "North", "Revenue Q1": 1200.5, "Revenue Q2": 1450, "_sourceUrl": "https://example.com/report", "_tableIndex": 0, "_rowIndex": 0}

Key-value store: TABLES (one entry per table: source, index, caption, rows, columns, file keys), STATS (counts and errors by code) and, if requested, the table-*.csv / table-*.xlsx files.

Error codes in STATS.errors: http_404 and other statuses, blocked_by_robots_txt, robots_txt_unavailable, timeout, dns_failure, page_too_large, unsupported_content_type, invalid_url, blocked_private_address, invalid_selector, no_tables_found.

Good to know

  • Static HTML only. Tables that a page builds with JavaScript after loading are not in the HTML this Actor reads.
  • You are responsible for the terms of use of the sites you extract from and for what you do with the data. This Actor fetches only the URLs you provide.
  • _tableIndex counts the tables matched by your selector (all tables if none), in document order.

More tools from the same developer