RecursionError: maximum recursion depth exceeded while calling a Python object

版权声明:原创作品请注明出处,谢谢。 https://blog.csdn.net/a2099948768/article/details/80883664

RecursionError: maximum recursion depth exceeded while calling a Python object

爬虫的朋友一般分页或者回调的时候就经常会遇到这个错误,英文意思很明白,超过了Python的最大递归深度。

解决方法很简单,在代码头部加入:

import sys
sys.setrecursionlimit(1000000)

这样修改Python最大递归为100万次,根据个人需求就可以了。

如果帮到你记得点赞哦。

猜你喜欢

转载自blog.csdn.net/a2099948768/article/details/80883664