from lxml import etree
info = f.read() # requests.get().text
# print(info)
selector=etree.HTML(info) #将源码转化为能被XPath匹配的格式
xx=selector.xpath("//img[@class=‘img-hover‘]/@src") #返回为一列表
xpath 笔记
原文:https://www.cnblogs.com/guanong/p/10352918.html