运行 Scrapy spider,报 AttributeError: 'set' object has no attribute 'items' 错误

在运行Scrapy爬虫时遇到AttributeError,问题源于'custom_settings'中ITEM_PIPELINES配置错误,将其从set更改为dict,例如:ITEM_PIPELINES = {'my_pipeline': 300},300表示pipeline的优先级。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

                                     运行 Scrapy spider,报 AttributeError: 'set' object has no attribute 'items' 错误

    通过scrapy  crawl 运行 某个 spider时,报 AttributeError: 'set' object has no attribute 'items' 错误,具体错误日志如下:

D:\PyCharmSource\ttjj_spider>scrapy crawl GetAllFundQuotationSpider
2019-03-13 21:20:57 [scrapy.utils.log] INFO: Scrapy 1.5.2 started (bot: ttjj_spider)
2019-03-13 21:20:57 [scrapy.utils.log] INFO: Versions: lxml 4.3.0.0, libxml2 2.9.5, cssselect 1.0.3, parsel 1.5.1, w3lib 1.20.0, Twisted 18.9.0, Python 3.7.2 (tag
s/v3.7.2:9a3ffc0492, Dec 23 2018, 22:20:52) [MSC v.1916 32 bit (Intel)], pyOpenSSL 19.0.0 (OpenSSL 1.1.1a  20 Nov 2018), cryptography 2.5, Platform Windows-10-10.
0.16299-SP0
Traceback (most recent call last):
  File "e:\python\python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值