问题
I have the following in my settings.py
ITEM_PIPELINES = ['mybot.pipelines.custompipeline']
But when I start scrapy, I get the following warning.
/lib/python2.7/site-packages/scrapy/contrib/pipeline/init.py:21: ScrapyDeprecationWarning: ITEM_PIPELINES defined as a list or a set is deprecated, switch to a dict category=ScrapyDeprecationWarning, stacklevel=1)
It still seems to be working properly. But, what do I need to do in order to remove this warning?
回答1:
see scrapy documentation for Activating an Item Pipeline component, for example:
ITEM_PIPELINES = {
'myproject.pipeline.custompipeline': 300,
}
The integer values you assign to classes in this setting determine the order they run in- items go through pipelines from order number low to high. It’s customary to define these numbers in the 0-1000 range.
回答2:
And of course you will need to do it in settings.py file of your project file..
来源:https://stackoverflow.com/questions/20881431/scrapy-item-pipelines-warning