Table Extractor

This Node Is Deprecated — This version of the node has been replaced with a new and improved version. The old version is kept for backwards-compatibility, but for all new workflows we suggest to use the version linked below.
Go to Suggested ReplacementTable Extractor

This node conveniently converts HTML tables into KNIME tables. It uses some simple heuristics to determine the column names. The result are three KNIME tables. The first KNIME table contains the HTML table’s content, the second and third KNIME tables contain the HTML table’s header and footer.

As KNIME supports no spanning rows or columns, rowspan and colspan attributes in the HTML table are mapped by simply copying the original cell’s content to the spanning cells.

The HTML table’s header is detected by checking, whether (1) all cells are of type th, or (2) the cells are contained within a thead element. The HTML table’s footer is detected through the tfoot element.

The KNIME table’s column names are generated from HTML table’s header. In case the header is a single row, the column names equal the HTML table’s header names. In case there is more than one row in the HTML table’s header, the rows are concatenated with “ > ”. In case the HTML table contains no header, the column names are synthetically generated (“column0”, “column1”, …)

Here’s an example HTML table:

Header A
Header B Header C Header D
Cell 1 Cell 2 Cell 3
Cell 4 Cell 5
Cell 6 Cell 7

This will result in the following KNIME content table:

Header A > Header B Header A > Header C Header A > Header D
Cell 1 Cell 2 Cell 3
Cell 4 Cell 5 Cell 5
Cell 4 Cell 6 Cell 7

And the KNIME header table:

Header A > Header B Header A > Header C Header A > Header D
Header A Header A Header A
Header B Header C Header D

The footer table would be empty in this example, because the HTML table contains no footer.

Options

Input
Input column which provides the WebElement which resembles the table
Treat rowspan and colspan as missing cells
Enable to empty strings or missing values (depending on next settings) for rowspan or colspan cells instead of repeating the original value.
Create missing values for missing cells
If this option is checked, missing value cells (instead of empty string cells) will be created for those cells, which are not explicitly defined within the HTML table.
Skip empty rows
Enable to skip entirely empty rows from the output tables.

Input Ports

Icon
Table with a column providing a WebElement which resembles the table to extract

Output Ports

Icon
The table content
Icon
The table’s header data
Icon
The table’s footer data

Views

This node has no views

Workflows

Links

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.