为了账号安全,请及时绑定邮箱和手机立即绑定

KeyError: 'Spider not found: douban_spider'

2018-07-15 17:38:54 [scrapy.utils.log] INFO: Scrapy 1.5.1 started (bot: douban)

2018-07-15 17:38:54 [scrapy.utils.log] INFO: Versions: lxml 4.2.3.0, libxml2 2.9.5, cssselect 1.0.3, parsel 1.5.0, w3lib 1.19.0, Twisted 17.5.0, Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:57:36) [MSC v.1900 64 bit (AMD64)], pyOpenSSL 18.0.0 (OpenSSL 1.1.0h  27 Mar 2018), cryptography 2.2.2, Platform Windows-7-6.1.7601-SP1

Traceback (most recent call last):

  File "D:\Program Files\python36\lib\site-packages\scrapy\spiderloader.py", line 69, in load

    return self._spiders[spider_name]

KeyError: 'douban_spider'


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "D:/我的资料库/douban/douban/main.py", line 2, in <module>

    cmdline.execute('scrapy crawl douban_spider'.split())

  File "D:\Program Files\python36\lib\site-packages\scrapy\cmdline.py", line 150, in execute

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

  File "D:\Program Files\python36\lib\site-packages\scrapy\cmdline.py", line 90, in _run_print_help

    func(*a, **kw)

  File "D:\Program Files\python36\lib\site-packages\scrapy\cmdline.py", line 157, in _run_command

    cmd.run(args, opts)

  File "D:\Program Files\python36\lib\site-packages\scrapy\commands\crawl.py", line 57, in run

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

  File "D:\Program Files\python36\lib\site-packages\scrapy\crawler.py", line 170, in crawl

    crawler = self.create_crawler(crawler_or_spidercls)

  File "D:\Program Files\python36\lib\site-packages\scrapy\crawler.py", line 198, in create_crawler

    return self._create_crawler(crawler_or_spidercls)

  File "D:\Program Files\python36\lib\site-packages\scrapy\crawler.py", line 202, in _create_crawler

    spidercls = self.spider_loader.load(spidercls)

  File "D:\Program Files\python36\lib\site-packages\scrapy\spiderloader.py", line 71, in load

    raise KeyError("Spider not found: {}".format(spider_name))

KeyError: 'Spider not found: douban_spider'

https://img1.sycdn.imooc.com//5b4b17ba00019fe505400539.jpg

这是面试报错的全部信息,名字完全是一样的,还是找不到

正在回答

2 回答

在cmd下输入scrapy看看是否输出项目名称

0 回复 有任何疑惑可以回复我~

这个主要是因为你在加载项目的时候,把上一层目录作为文件夹导入进来了,重新导入,选择具体项目的那个文件夹即可

0 回复 有任何疑惑可以回复我~
#1

二的二次方

正解呀~解决问题了
2020-04-02 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

KeyError: 'Spider not found: douban_spider'

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信