util.py 文件源码

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

项目:oadoi 作者: Impactstory 项目源码 文件源码
def get_tree(page):
    page = page.replace(" ", " ")  # otherwise starts-with for lxml doesn't work
    try:
        tree = html.fromstring(page)
    except (etree.XMLSyntaxError, etree.ParserError) as e:
        print u"not parsing, beause etree error in get_tree: {}".format(e)
        tree = None
    return tree
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号