NOTICE: All information contained herein is, and remains
the property of TechnoCore Automate.
The ObjImportApi class in ObjDataImportHtml.py imports data from HTML
tables using pandas.read_html(). It follows the same open_file /
column_list / next_row / close_file interface used by all other
ObjDataImport* modules.
The first <table> found in the HTML is used. Both local files and URLs
(http/https) are supported.
prep_file(filename) -> strNo-op — returns the filename unchanged.
open_file(filename)Parses the HTML source and extracts the first table. The filename parameter
can be either a local file path or a URL starting with http.
Column names are taken from the DataFrame column headers. The DataFrame is
converted to a list of dicts for internal storage.
close_file()Releases the in-memory record list.
column_list() -> listReturns the column names from the HTML table headers.
next_row() -> list | strReturns the next record as a list of values in column order. Missing keys are
returned as "". Returns "EOF" when all records have been read.
importer = ObjImportApi()
importer.open_file("report.html")
columns = importer.column_list()
print("Columns:", columns)
while True:
row = importer.next_row()
if row == "EOF":
break
print(dict(zip(columns, row)))
importer.close_file()
Importing from a URL:
importer = ObjImportApi()
importer.open_file("https://example.com/data.html")
Requires pandas and lxml (or html5lib) for HTML table parsing.
Updated: 2026-03-22