如何在Python中设置urllib2.urlopen的最大重定向数?

时间:2013-07-01 19:01:04

标签: python

我想为urllib2.urlopen()最多允许3次重定向。如何在urllib2.urlopen中指定?

1 个答案:

答案 0 :(得分:1)

您定义了自己的HTTPRedirectHandler,用于计算重定向的数量,然后install it to be used by urllib2

相关问题