xpath 笔记 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") #返回为一列表 posted on 2019-02-05 17:52 吃瓜的瓜农 阅读( ...) 评论( ...) 编辑 收藏 转载于:https://www.cnblogs.com/guanong/p/10352918.html