def import_from_html(<EOL>filename_or_fobj,<EOL>encoding="<STR_LIT:utf-8>",<EOL>index=<NUM_LIT:0>,<EOL>ignore_colspan=True,<EOL>preserve_html=False,<EOL>properties=False,<EOL>table_tag="<STR_LIT>",<EOL>row_tag="<STR_LIT>",<EOL>column_tag="<STR_LIT>",<EOL>*args,<EOL>**kwargs<EOL>):
source = Source.from_file(<EOL>filename_or_fobj, plugin_name="<STR_LIT:html>", mode="<STR_LIT:rb>", encoding=encoding<EOL>)<EOL>html = source.fobj.read().decode(source.encoding)<EOL>html_tree = document_fromstring(html)<EOL>tables = html_tree.xpath("<STR_LIT>".format(table_tag))<EOL>table = tables[index]<EOL>strip_tags(table, "<STR_LIT>")<EOL>strip_tags(table, "<STR_LIT>")<EOL>row_elements = table.xpath(row_tag)<EOL>table_rows = [<EOL>_get_row(<EOL>row,<EOL>column_tag=column_tag,<EOL>preserve_html=preserve_html,<EOL>properties=properties,<EOL>)<EOL>for row in row_elements<EOL>]<EOL>if properties:<EOL><INDENT>table_rows[<NUM_LIT:0>][-<NUM_LIT:1>] = "<STR_LIT>"<EOL><DEDENT>if preserve_html and kwargs.get("<STR_LIT>", None) is None:<EOL><INDENT>table_rows[<NUM_LIT:0>] = list(map(_extract_node_text, row_elements[<NUM_LIT:0>]))<EOL><DEDENT>if ignore_colspan:<EOL><INDENT>max_columns = max(map(len, table_rows))<EOL>table_rows = [row for row in table_rows if len(row) == max_columns]<EOL><DEDENT>meta = {"<STR_LIT>": "<STR_LIT:html>", "<STR_LIT:source>": source}<EOL>return create_table(table_rows, meta=meta, *args, **kwargs)<EOL>
Return rows.Table from HTML file.