def rsess():
s = requests.Session()
# Just so one random 500 doesn't break an uptime; two consecutive errors are
# worrying though.
s.mount('http://', HTTPAdapter(max_retries=MAX_RETRIES))
s.mount('https://', HTTPAdapter(max_retries=MAX_RETRIES))
s.headers.update({
'User-Agent': USER_AGENT,
})
return s
评论列表
文章目录