[英]How to set the maximum number of redirects for urllib2.urlopen in Python?
I would like to allow maximum of 3 redirects for urllib2.urlopen()
. 我想为
urllib2.urlopen()
最多允许3个重定向。 How do I specify that in urllib2.urlopen
? 如何在
urllib2.urlopen
指定urllib2.urlopen
?
您定义自己的HTTPRedirectHandler
,它计算重定向的数量,然后安装它以供urllib2使用 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.