刮擦物品管线警告

2024-09-30 16:27:55 发布

您现在位置:Python中文网/ 问答频道 /正文

我在我的设置.py在

ITEM_PIPELINES = ['mybot.pipelines.custompipeline']

但当我开始发痒时,我得到了以下警告。在

/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)

它似乎仍在正常工作。但是,要删除此警告,我需要做些什么?在


Tags: py警告pipelineinitlibpackagessiteitem
2条回答

当然你需要在设置.py项目文件的文件。。在

请参阅Activating an Item Pipeline component的废文档,例如:

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.

相关问题 更多 >