python - crawl pictures from web site with Scrapy -
i want crawl image of each bottle of wine web site of vinnicolas , save in svc file.
unfortunately, got errors :
spider : https://gist.github.com/anonymous/6424305
pipelines.py. : https://gist.github.com/nahali/6434932
settings.py :
your parse_wine_page
not set "image_urls" field value in items, middleware not download images
import urlparse ... def parse_wine_page(self, reponse): ... hxs = htmlxpathselector(response) content = hxs.select('//*[@id="glo_right"]') 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
also make sure projetvinnicolas3item
class has "images" , "image_urls" fields()
Comments
Post a Comment