爬虫遇到此类情况RecursionError: maximum recursion depth exceeded while calling a Python object

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

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

import sys
sys.setrecursionlimit(1000000)
这样修改Python最大递归,自定义即可
爬虫遇到此类情况RecursionError: maximum recursion depth exceeded while calling a Python object