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

这个报错是什么原因?

Traceback (most recent call last):

  File "/Users/lixuan/Documents/workspace/imooc/baike_spider/spider_main.py", line 48, in <module>

    obj_spider.craw(root_url)

  File "/Users/lixuan/Documents/workspace/imooc/baike_spider/spider_main.py", line 21, in craw

    self.urls.add_new_url(root_url)

  File "/Users/lixuan/Documents/workspace/imooc/baike_spider/url_manager.py", line 19, in add_new_url

    self.add_new_urls(url)

  File "/Users/lixuan/Documents/workspace/imooc/baike_spider/url_manager.py", line 25, in add_new_urls

    self.add_new_url(url)

  File "/Users/lixuan/Documents/workspace/imooc/baike_spider/url_manager.py", line 19, in add_new_url

    self.add_new_urls(url)

  File "/Users/lixuan/Documents/workspace/imooc/baike_spider/url_manager.py", line 25, in add_new_urls

    self.add_new_url(url)

  File "/Users/lixuan/Documents/workspace/imooc/baike_spider/url_manager.py", line 19, in add_new_url

    self.add_new_urls(url)

  File "/Users/lixuan/Documents/workspace/imooc/baike_spider/url_manager.py", line 25, in add_new_urls

    self.add_new_url(url)

  File "/Users/lixuan/Documents/workspace/imooc/baike_spider/url_manager.py", line 19, in add_new_url

    self.add_new_urls(url)

  File "/Users/lixuan/Documents/workspace/imooc/baike_spider/url_manager.py", line 25, in add_new_urls

    self.add_new_url(url)

     self.add_new_url(url)

 一下省略数行

RuntimeError: maximum recursion depth exceeded


正在回答

2 回答

/url_manager.py 19行和25行代码仔细看看。没贴出代码没法进一步看

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

函数递归层次太深 代码需要修改

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

举报

0/150
提交
取消
Python开发简单爬虫
  • 参与学习       227670    人
  • 解答问题       1219    个

本教程带您解开python爬虫这门神奇技术的面纱

进入课程

这个报错是什么原因?

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