Scrapy ITEM_PIPELINES 警告 [英] Scrapy ITEM_PIPELINES warning

查看:40
本文介绍了Scrapy ITEM_PIPELINES 警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 settings.py 中有以下内容

ITEM_PIPELINES = ['mybot.pipelines.custompipeline']

但是当我开始scrapy时,我收到以下警告.

<块引用>

/lib/python2.7/site-packages/scrapy/contrib/pipeline/init.py:21: ScrapyDeprecationWarning: ITEM_PIPELINES 定义为列表或集合已弃用,切换到字典category=ScrapyDeprecationWarning, stacklevel=1)

它似乎仍然正常工作.但是,我需要做什么才能消除此警告?

解决方案

查看 激活一个Item Pipeline组件,例如:

ITEM_PIPELINES = {'myproject.pipeline.custompipeline': 300,}

<块引用>

您在此设置中分配给类的整数值决定了它们在项目中从订单号低到高通过管道的运行顺序.通常将这些数字定义在 0-1000 范围内.

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?

解决方案

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.

这篇关于Scrapy ITEM_PIPELINES 警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆