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.
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.
To use this node in KNIME, install the extension Selenium Nodes for KNIME from the below update site following our NodePit Product and Node Installation Guide:
A zipped version of the software site can be downloaded here.
Deploy, schedule, execute, and monitor your KNIME workflows locally, in the cloud or on-premises – with our brand new NodePit Runner.
Try NodePit Runner!Do you have feedback, questions, comments about NodePit, want to support this platform, or want your own nodes or workflows listed here as well? Do you think, the search results could be improved or something is missing? Then please get in touch! Alternatively, you can send us an email to mail@nodepit.com.
Please note that this is only about NodePit. We do not provide general support for KNIME — please use the KNIME forums instead.