belvaParseXML.py 文件源码

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

项目:Basic-Expression-Lexicon-Variation-Algorithms-BELVA 作者: kenb123 项目源码 文件源码
def parseHTMLxpathSearch(http_source, xpathString):
#---------------------------------------------------------------------------------

    return_values = []


    http_source= str(http_source).replace('\x00','')
    try:
        html = lxml.html.fromstring(http_source)

        for data in html.xpath(xpathString):
            return_values.append(etree.tostring(data.content))
            data.clear()

    except:
        pass

    return return_values



#---------------------------------------------------------------------------------
# parse HTML and return value asked
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号