def html_table_parser(self, res_name):
"""
Method to instantiate HtmlTableParser, analyze tables and then give in output a list of tables.
:param res_name: resource that has to be analyzed
:return: list of tables found
"""
html_doc_tree = self.html_object_getter(res_name)
# if html doc is defined
if html_doc_tree:
graph = rdflib.Graph()
# instantiate html table parser
html_table_parser = HtmlTableParser.HtmlTableParser(html_doc_tree, self.chapter, graph,
self.topic, res_name, self.utils, False)
# if there are tables to analyze
if html_table_parser:
# analyze and parse tables
html_table_parser.analyze_tables()
return html_table_parser.all_tables
# if there aren't tables to analyze result will be empty
else:
return ""
# if html doc is not defined result will be empty
else:
return ""
评论列表
文章目录