KeyError: 'Spider not found: test'
Posted hpcm
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了KeyError: 'Spider not found: test'相关的知识,希望对你有一定的参考价值。
Error Msg:
File "c:python36libsite-packagesscrapycmdline.py", line 157, in _run_command cmd.run(args, opts) File "c:python36libsite-packagesscrapycommandscrawl.py", line 57, in run self.crawler_process.crawl(spname, **opts.spargs) File "c:python36libsite-packagesscrapycrawler.py", line 170, in crawl crawler = self.create_crawler(crawler_or_spidercls) File "c:python36libsite-packagesscrapycrawler.py", line 198, in create_crawler return self._create_crawler(crawler_or_spidercls) File "c:python36libsite-packagesscrapycrawler.py", line 202, in _create_crawler spidercls = self.spider_loader.load(spidercls) File "c:python36libsite-packagesscrapyspiderloader.py", line 71, in load raise KeyError("Spider not found: {}".format(spider_name)) KeyError: ‘Spider not found: test‘
问题:
spider中定义的爬虫名字和使用的爬虫名字不符
解决:
修改正确
以上是关于KeyError: 'Spider not found: test'的主要内容,如果未能解决你的问题,请参考以下文章
Pandas 0.20.3“KeyError:'[1 2] not in index'”尝试选择要在 DataFrame 中显示的列时 [重复]
python3 日志检索异常抛出异常 raise KeyError(key),KeyError: 'formatters'
Doc2Vec -- "tag '23943' not seen in training corpus/invalid" 错误