qq_41605450
2020-05-09 17:22
采纳率: 100%
浏览 368
已结题

做爬虫毕设的时候,重装了系统,重新搭建环境之后scrapy爬虫无法正常运行了,爆出以下错误,求助

StopIteration:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\dell\AppData\Local\Programs\Python\Python38-32\lib\site-packages\scrapy\utils\defer.py", line 55, in mustbe_deferred
result = f(*args, **kw)
File "C:\Users\dell\AppData\Local\Programs\Python\Python38-32\lib\site-packages\scrapy\core\spidermw.py", line 60, in process_spider_input
return scrape_func(response, request, spider)
File "C:\Users\dell\AppData\Local\Programs\Python\Python38-32\lib\site-packages\scrapy\core\scraper.py", line 152, in call_spider
warn_on_generator_with_return_value(spider, callback)
File "C:\Users\dell\AppData\Local\Programs\Python\Python38-32\lib\site-packages\scrapy\utils\misc.py", line 202, in warn_on_generator_with_return_value
if is_generator_with_return_value(callable):
File "C:\Users\dell\AppData\Local\Programs\Python\Python38-32\lib\site-packages\scrapy\utils\misc.py", line 187, in is_generator_with_return_value
tree = ast.parse(dedent(inspect.getsource(callable)))
File "C:\Users\dell\AppData\Local\Programs\Python\Python38-32\lib\ast.py", line 47, in parse
return compile(source, filename, mode, flags,
File "", line 1
def parse(self, response):
^
IndentationError: unexpected indent
2020-05-09 17:20:15 [scrapy.core.engine] INFO: Closing spider (finished)

  • 点赞
  • 收藏

2条回答 默认 最新

  • nieoding 2020-05-09 18:04
    已采纳

    检查一下你的缩进是不是有问题

    点赞 打赏 评论
  • qq_41605450 2020-05-09 18:11

    应该没问题吧,之前没重装系统之前是可以顺利运行的。重装之后就出现这种情况了

    点赞 打赏 评论

相关推荐 更多相似问题