2024-04-25 23:30:03 发布
网友
我想从vinnicolas的网站上抓取每瓶葡萄酒的图片并保存在svc文件中。在
不幸的是,我有一些错误:
蜘蛛:https://gist.github.com/anonymous/6424305
在管道.py. :https://gist.github.com/nahali/6434932
在设置.py公司名称:
您的parse_wine_page没有在项目中设置“image_url”字段值,因此中间件不会下载任何图像
parse_wine_page
import urlparse ... def parse_wine_page(self, reponse): ... hxs = HtmlXPathSelector(response) content = hxs.select('//*[@id="glo_right"]') for res in content: ... #item ["Image"]= map(unicode.strip, res.select('//div[@class="pro_detail_tit"]//div[@class="pro_titre"]/h1/text()').extract()) item['image_urls'] = map(lambda src: urlparse.urljoin(response.url, src), res.select('./div[@class="pro_col_left"]/img/@src').extract()) items.append(item) return items
还要确保您的Projetvinnicolas3Item类有“images”和“image\u url”字段()
Projetvinnicolas3Item
您的
parse_wine_page
没有在项目中设置“image_url”字段值,因此中间件不会下载任何图像还要确保您的
Projetvinnicolas3Item
类有“images”和“image\u url”字段()相关问题 更多 >
编程相关推荐