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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -