推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
chendajun
V2EX  ›  Python

scrapy_redis 报错

  •  
  •   chendajun · Jun 10, 2016 · 3083 views
    This topic created in 3708 days ago, the information mentioned may be changed or developed.
    用 scrapy_redis 作为 scrapy 爬虫的排重数据库,之前用 Python2.x 没问题,现在想升级到 Python3.5 报了个错误,报错如下:[2016-06-10 19:44:35,905]CRITICAL:Unhandled Error
    Traceback (most recent call last):
    File "d:\python3.5.1\lib\site-packages\scrapy\commands\crawl.py", line 58, in run
    self.crawler_process.start()
    File "d:\python3.5.1\lib\site-packages\scrapy\crawler.py", line 280, in start
    reactor.run(installSignalHandlers=False) # blocking call
    File "d:\python3.5.1\lib\site-packages\twisted\internet\base.py", line 1194, in run
    self.mainLoop()
    File "d:\python3.5.1\lib\site-packages\twisted\internet\base.py", line 1203, in mainLoop
    self.runUntilCurrent()
    --- <exception caught here> ---
    File "d:\python3.5.1\lib\site-packages\twisted\internet\base.py", line 825, in runUntilCurrent
    call.func(*call.args, **call.kw)
    File "d:\python3.5.1\lib\site-packages\scrapy\utils\reactor.py", line 41, in __call__
    return self._func(*self._a, **self._kw)
    File "d:\python3.5.1\lib\site-packages\scrapy\core\engine.py", line 134, in _next_request
    self.crawl(request, spider)
    File "d:\python3.5.1\lib\site-packages\scrapy\core\engine.py", line 209, in crawl
    self.schedule(request, spider)
    File "d:\python3.5.1\lib\site-packages\scrapy\core\engine.py", line 215, in schedule
    if not self.slot.scheduler.enqueue_request(request):
    File "d:\python3.5.1\lib\site-packages\scrapy_redis\scheduler.py", line 78, in enqueue_request
    self.queue.push(request)
    File "d:\python3.5.1\lib\site-packages\scrapy_redis\queue.py", line 83, in push
    self.server.zadd(self.key, **pairs)
    builtins.TypeError: zadd() keywords must be strings
    新手,不知道咋解决。
    4 replies    2017-12-16 17:08:07 +08:00
    mkeith
        1
    mkeith  
       Jun 11, 2016
    zadd() keywords must be strings
    Jimmy93
        2
    Jimmy93  
       Dec 16, 2017
    TypeError: zadd() keywords must be strings
    Jimmy93
        3
    Jimmy93  
       Dec 16, 2017
    TypeError: zadd() keywords must be strings
    这个都能看懂,但是要怎么修改?
    Jimmy93
        4
    Jimmy93  
       Dec 16, 2017
    是因为不支持 py3 吗?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2897 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 14:59 · PVG 22:59 · LAX 07:59 · JFK 10:59
    ♥ Do have faith in what you're doing.