8

一日一技:Scrapy最新版不兼容scrapy_redis的问题

 1 year ago
source link: https://www.kingname.info/2023/08/20/scrapy-redis-no-crawler/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

一日一技:Scrapy最新版不兼容scrapy_redis的问题

2023-08-20

17

180

1 分钟

有不少同学在写爬虫时,会使用Scrapy + scrapy_redis实现分布式爬虫。不过scrapy_redis最近几年更新已经越来越少,有一种廉颇老矣的感觉。Scrapy的很多更新,scrapy_redis已经跟不上了。

大家在安装Scrapy时,如果没有指定具体的版本,那么就会默认安装最新版。

这两天如果有同学安装了最新版的Scrapy和scrapy_redis,运行以后就会出现下面的报错:

TypeError: crawl() got an unexpected keyword argument 'spider'

如下图所示:

20230820152921.png

遇到这种情况,解决方法非常简单,不要安装Scrapy最新版就可以了。在使用pip安装时,绑定Scrapy版本:

python3 -m pip install scrapy==2.9.0

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK