custom_settings
应该是类属性:
class IndexSpider(scrapy.Spider):
name = "indices"
# set custom settings
custom_settings = {
'DOWNLOAD_DELAY': 2,
'ITEM_PIPELINES': {
'freedom.pipelines.IndexPipeline': 300
}
}
def __init__(self, *args, **kwargs):
super(IndexSpider, self).__init__(*args, **kwargs)