scrapy crawl douban_spider这个出错

来源:2-6 spider文件的编写(1)

灰灰grey

2018-07-26 14:31

  File "d:\jsuk\python37\lib\runpy.py", line 85, in _run_code

    exec(code, run_globals)

  File "D:\JsuK\Python37\Scripts\scrapy.exe\__main__.py", line 9, in <module>

  File "d:\jsuk\python37\lib\site-packages\scrapy\cmdline.py", line 150, in exec

ute

    _run_print_help(parser, _run_command, cmd, args, opts)

  File "d:\jsuk\python37\lib\site-packages\scrapy\cmdline.py", line 90, in _run_

print_help

    func(*a, **kw)

  File "d:\jsuk\python37\lib\site-packages\scrapy\cmdline.py", line 157, in _run

_command

    cmd.run(args, opts)

  File "d:\jsuk\python37\lib\site-packages\scrapy\commands\crawl.py", line 57, i

n run

    self.crawler_process.crawl(spname, **opts.spargs)

  File "d:\jsuk\python37\lib\site-packages\scrapy\crawler.py", line 170, in craw

l

    crawler = self.create_crawler(crawler_or_spidercls)

  File "d:\jsuk\python37\lib\site-packages\scrapy\crawler.py", line 198, in crea

te_crawler

    return self._create_crawler(crawler_or_spidercls)

  File "d:\jsuk\python37\lib\site-packages\scrapy\crawler.py", line 203, in _cre

ate_crawler

    return Crawler(spidercls, self.settings)

  File "d:\jsuk\python37\lib\site-packages\scrapy\crawler.py", line 55, in __ini

t__

    self.extensions = ExtensionManager.from_crawler(self)

  File "d:\jsuk\python37\lib\site-packages\scrapy\middleware.py", line 58, in fr

om_crawler

    return cls.from_settings(crawler.settings, crawler)

  File "d:\jsuk\python37\lib\site-packages\scrapy\middleware.py", line 34, in fr

om_settings

    mwcls = load_object(clspath)

  File "d:\jsuk\python37\lib\site-packages\scrapy\utils\misc.py", line 44, in lo

ad_object

    mod = import_module(module)

  File "d:\jsuk\python37\lib\importlib\__init__.py", line 127, in import_module

    return _bootstrap._gcd_import(name[level:], package, level)

  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import

  File "<frozen importlib._bootstrap>", line 983, in _find_and_load

  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked

  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked

  File "<frozen importlib._bootstrap_external>", line 728, in exec_module

  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed

  File "d:\jsuk\python37\lib\site-packages\scrapy\extensions\telnet.py", line 12

, in <module>

    from twisted.conch import manhole, telnet

  File "d:\jsuk\python37\lib\site-packages\twisted\conch\manhole.py", line 154

    def write(self, data, async=False):

                              ^

SyntaxError: invalid syntax

求大神指教

写回答 关注

4回答

  • 慕工程8450215
    2018-09-05 09:34:53

    哪个地方的async????

  • Lysokin
    2018-08-09 16:09:41

    同样碰到该问题,请教,怎么解决

    慕码人008... 回复Lysoki...

    谢谢大神 你的答案很好的解决了我的问题

    2018-08-19 23:57:21

    共 2 条回复 >

  • 冰风
    2018-07-26 17:16:43

    我也是同样的错误..不知道是哪里错了.

  • 灰灰grey
    2018-07-26 17:08:04

    将async随便换一个字段,例如:shark就可以了

Python最火爬虫框架Scrapy入门与实践

做为爬虫工程师Python Scrapy主流爬虫框架你必须要会!

67418 学习 · 223 问题

查看课程

相似问题