mirror of https://github.com/scrapy/scrapy.git
add middleware to template project
This commit is contained in:
parent
6cc83c041e
commit
d5bd44a5b9
|
|
@ -17,6 +17,7 @@ TEMPLATES_TO_RENDER = (
|
|||
('${project_name}', 'settings.py.tmpl'),
|
||||
('${project_name}', 'items.py.tmpl'),
|
||||
('${project_name}', 'pipelines.py.tmpl'),
|
||||
('${project_name}', 'middleware.py.tmpl'),
|
||||
)
|
||||
|
||||
IGNORE = ignore_patterns('*.pyc', '.svn')
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Define here the models for your spider middleware
|
||||
#
|
||||
# See documentation in:
|
||||
# http://doc.scrapy.org/en/latest/topics/spider-middleware.html
|
||||
|
||||
|
||||
class ${ProjectName}SpiderMiddleware(object):
|
||||
# This method is called for each response that goes through the
|
||||
# spider middleware and into the spider, for processing.
|
||||
|
||||
def process_spider_input(response, spider):
|
||||
# Called for each response that goes to spider
|
||||
pass
|
||||
|
||||
def process_spider_output(response, result, spider):
|
||||
# Called for each response with the spider results
|
||||
pass
|
||||
|
||||
def process_spider_exception(response, exception, spider):
|
||||
# Called whenever a spider raises an exception
|
||||
pass
|
||||
Loading…
Reference in New Issue