HTML Table Extractor
Pricing
$1.00 / 1,000 results
HTML Table Extractor
Extract static HTML tables from a list of URLs and export one dataset item per table row.
Pricing
$1.00 / 1,000 results
Rating
0.0
(0)
Developer
Ming Zhang
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
0
Monthly active users
a day ago
Last modified
Categories
Features
Share
Export tables from a list of web pages to an Apify dataset. The Actor reads static HTML over HTTP(S). It runs without a browser and does not execute JavaScript or load page assets. Tables rendered by JavaScript after page load are outside its scope.
Input
| Field | Default | What it controls |
|---|---|---|
startUrls | Required | List of HTTP(S) page URLs. |
selector | All tables | CSS selector that matches the table element, such as #prices or main table.stats. |
tableIndex | All indices | Zero-based index among non-nested HTML tables in document order, before selector and visibility filtering. When both filters are supplied, the table must meet both. |
{"startUrls": ["https://example.com/prices"],"selector": "main table.stats","tableIndex": 0}
Output
The Actor writes one dataset item per data row. Each item contains the input url, the table's tableIndex, and one string field per expanded column. For example, a table with City and Sales headers could produce this row.
{"url": "https://example.com/prices","tableIndex": 0,"City": "Rome","Sales / Q1": "10","Sales / Q2": "20"}
- Headers come from the visible
<thead>rows or, when there is no visible table head, a first visible row made entirely of<th>cells. Multi-row labels are joined with/. - Merged cells repeat their text across occupied columns or rows. Rowspans stay within their row group. Missing cells are empty strings.
- Unnamed columns use
column_1,column_2, and so on. Duplicate names and collisions withurlortableIndexreceive a numbered suffix such as_2. - Nested tables contribute text to their containing cells. Elements marked
hidden,aria-hidden="true", or inlinedisplay: noneare skipped. Visibility rules from stylesheets are outside the scope of the parser.
Request behavior
- The Actor uses one request at a time with the user agent
OneRice-HTMLTableExtractor/0.1and a 15-second timeout. - HTML responses are limited to 5 MiB after decompression. The Actor skips tables whose expanded grid would exceed 1,000,000 cells. Failed pages and skipped tables are logged.
- Users are responsible for checking and following each site's
robots.txtand access rules. The Actor does not fetch or enforcerobots.txt.
Pricing
Pay per result at $1 per 1,000 extracted rows. When publishing, the owner sets the Apify pay-per-event price to $0.001 for the apify-default-dataset-item event. It bills one result for each row written to the default dataset. Apify pay-per-event documentation
Local development
Use Node.js 24 or newer. Run npm install, then npm test for offline tests with HTML fixtures. To run the Actor locally, place input JSON in storage/key_value_stores/default/INPUT.json and run npm start.
The Dockerfile uses Apify’s Node.js base image. Apify Dockerfile documentation