Scrapy报错'float' object is not iterable解决方法

ypeError: 'float' object is not iterable
2018-02-02 10:13:50 [scrapy] ERROR: Error downloading <GET http://quotes.toscrape.com/page/2/>
TypeError: 'float' object is not iterable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/mwl/anaconda3/lib/python3.5/site-packages/twisted/internet/defer.py", line 1299, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/home/mwl/anaconda3/lib/python3.5/site-packages/twisted/python/failure.py", line 393, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/home/mwl/anaconda3/lib/python3.5/site-packages/scrapy/core/downloader/middleware.py", line 43, in process_request
    defer.returnValue((yield download_func(request=request,spider=spider)))
  File "/home/mwl/anaconda3/lib/python3.5/site-packages/scrapy/utils/defer.py", line 45, in mustbe_deferred
    result = f(*args, **kw)
  File "/home/mwl/anaconda3/lib/python3.5/site-packages/scrapy/core/downloader/handlers/__init__.py", line 65, in download_request
    return handler.download_request(request, spider)

搜索发现是Twisted库的版本问题,我使用的是conda安装的默认Twisted的版本是17.1.0需要降级到16.6.0,使用命令conda install Twisted==16.6.0。
参考这个

发布了2 篇原创文章 · 获赞 0 · 访问量 2134
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 编程工作室 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览