我正在尝试使用xpath "https://example.com/example.jpg"
获取第一个URL @src
,但结果总是/Content/images/defaultThumb.jpg
<img class="pimg" src="https://example.com/example.jpg" onerror="this.src = '/Content/images/defaultThumb.jpg'" title="test" alt="test" style="">
答案 0 :(得分:0)
您的xpath错误,请尝试...
scrapy shell "https://www.trendyol.com/versace?qt=versace"
response.xpath('//img[@class="primg lazy"]/@data-original').extract()