1、request的连接数过多而导致Max retries exceeded,在header中不使用持久连接
将headers中的 'Connection': 'close'
或requests.adapters.DEFAULT_RETRIES = 5
2、针对请求请求速度过快导致程序报错。
import time
num = 3
while num:
try:
page = requests.get(url)
except:
time.sleep(5)
num -= 1
continue