Added template for CSVFeedSpiders

--HG--
extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40480
This commit is contained in:
elpolilla 2008-12-08 13:42:25 +00:00
parent 528d239124
commit 677064964b
2 changed files with 23 additions and 1 deletions

View File

@ -0,0 +1,23 @@
# -*- coding: utf8 -*-
from decobot.common.spiders import DecobotCSVFeedSpider
class $classname(CSVFeedSpider):
domain_name = "$site"
start_urls = ['http://www.$site/feed.csv']
# headers = ['id', 'name', 'description', 'image_link']
# delimiter = '\t'
# Do any adaptations you need here
#def adapt_response(self, response):
# return response
def parse_row(self, response, row):
p = self.create_product(response)
#p.attribute("site_id", row["id"])
#p.attribute("supplier", self.domain_name)
#p.attribute("name", row["name"])
#p.attribute("description", row["description"])
#p.attribute("image_urls", row["image_link"])
return p
SPIDER = $classname()

View File

@ -1,5 +1,4 @@
# -*- coding: utf8 -*-
from scrapy.xpath import HtmlXPathSelector
from scrapy.contrib.spiders import XMLFeedSpider
class $classname(XMLFeedSpider):