Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

templates: updated code

Rolando Espinoza La fuente7bbc14dd1523
diff --git a/scrapy/templates/project/module/pipelines.py.tmpl b/scrapy/templates/project/module/pipelines.py.tmpl
index fa6f5ea6f..e3f89342d 100644
--- a/scrapy/templates/project/module/pipelines.py.tmpl
+++ b/scrapy/templates/project/module/pipelines.py.tmpl
@@ -4,5 +4,5 @@
# See: http://doc.scrapy.org/topics/item-pipeline.html
class ${ProjectName}Pipeline(object):
- def process_item(self, domain, item):
+ def process_item(self, spider, item):
return item
diff --git a/scrapy/templates/spiders/crawl.tmpl b/scrapy/templates/spiders/crawl.tmpl
index 2d4f7fce6..18fd0ec42 100644
--- a/scrapy/templates/spiders/crawl.tmpl
+++ b/scrapy/templates/spiders/crawl.tmpl
@@ -10,15 +10,15 @@ class $classname(CrawlSpider):
start_urls = ['http://www.$site/']
rules = (
- Rule(SgmlLinkExtractor(allow=(r'Items/', )), 'parse_item', follow=True),
+ Rule(SgmlLinkExtractor(allow=r'Items/'), callback='parse_item', follow=True),
)
def parse_item(self, response):
- xs = HtmlXPathSelector(response)
+ hxs = HtmlXPathSelector(response)
i = ${ProjectName}Item()
- #i['site_id'] = xs.select('//input[@id="sid"]/@value').extract()
- #i['name'] = xs.select('//div[@id="name"]').extract()
- #i['description'] = xs.select('//div[@id="description"]').extract()
+ #i['site_id'] = hxs.select('//input[@id="sid"]/@value').extract()
+ #i['name'] = hxs.select('//div[@id="name"]').extract()
+ #i['description'] = hxs.select('//div[@id="description"]').extract()
return i
SPIDER = $classname()