顺其自然s1
2018-07-15 17:46
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'
这是面试报错的全部信息,名字完全是一样的,还是找不到
在cmd下输入scrapy看看是否输出项目名称
这个主要是因为你在加载项目的时候,把上一层目录作为文件夹导入进来了,重新导入,选择具体项目的那个文件夹即可
Python最火爬虫框架Scrapy入门与实践
67418 学习 · 223 问题
相似问题