Scrapy ITEM_PIPELINES warning

依然范特西╮ 提交于 2019-12-22 06:48:45

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!