>>> response.xpath(‘//base/@href‘).extract()
>>> response.css(‘base::attr(href)‘).extract()
>>> response.xpath(‘//a[contains(@href, "image")]/@href‘).extract()
>>> response.css(‘a[href*=image]::attr(href)‘).extract()
>>> response.xpath(‘//a[contains(@href, "image")]/img/@src‘).extract()
>>> response.css(‘a[href*=image] img::attr(src)‘).extract()
>>> response.xpath(‘//a[contains(@href, "image")]/text()‘).re(r‘Name:\s*(.*)‘)
>>> sel.xpath(‘//li[re:test(@class, "item-\d$")]//@href‘).extract()
原文:http://my.oschina.net/jlan/blog/525521