在我的 settings.py 中,我有:
ITEM_PIPELINES = {
'turing.pipelines.InitFieldsNotInitializedPipeline': 299,
'turing.pipelines.SetNoneIfFieldEmptyPipeline': 300,
'turing.pipelines.CheckCategoryPipeline': 301,
'turing.pipelines.CheckContactPipeline': 302,
}
而且效果很好。但有时我想在没有任何管道的情况下运行蜘蛛。当我跑
scrapy crawl -s FEED_URI=stdout: -s FEED_FORMAT=json -s ITEM_PIPELINES=[] example_spider
我收到此错误:
return d.iteritems(**kw)
exceptions.AttributeError: 'str' object has no attribute 'iteritems'
如何在没有管道的情况下运行蜘蛛?
到目前为止,我尝试过:
scrapy crawl -s FEED_URI=stdout: -s FEED_FORMAT=json -s ITEM_PIPELINES=[] example_spider
scrapy crawl -s FEED_URI=stdout: -s FEED_FORMAT=json -s ITEM_PIPELINES={} example_spider
scrapy crawl -s FEED_URI=stdout: -s FEED_FORMAT=json -s "ITEM_PIPELINES=[]" example_spider
scrapy crawl -s FEED_URI=stdout: -s FEED_FORMAT=json -s "ITEM_PIPELINES={}" example_spider
scrapy crawl -s FEED_URI=stdout: -s FEED_FORMAT=json -s ITEM_PIPELINES=['turing.pipelines.InitFieldsNotInitializedPipeline': 299,] example_spider
scrapy crawl -s FEED_URI=stdout: -s FEED_FORMAT=json -s ITEM_PIPELINES={'turing.pipelines.InitFieldsNotInitializedPipeline': 299,} example_spider
其他组合查看文档http://doc.scrapy.org/en/latest/topics/settings.html
希望你能帮助我。谢谢。