ExplorerTools.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:table-extractor 作者: dbpedia 项目源码 文件源码
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 ""
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号