scrapy

response.selector.xpath('//')#//从根开始匹配 

.xpath('//img[@*])#找出所有img的所有属性

.xpath('//img/@src').extract()#找出所有img的src属性

.xpath('//a[@href='index.html']').extract()#找出a标签href='index.html'

.xpath('//a[contains(@href)]/img')

原文地址:https://www.cnblogs.com/howhy/p/7748063.html