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
belvaParseXML.py 文件源码
python
阅读 29
收藏 0
点赞 0
评论 0
评论列表
文章目录