Python urllib2允许使用代理在url上重定向

Python urllib2允许使用代理在url上重定向,python,proxy,urllib2,Python,Proxy,Urllib2,我正在使用urllib2使用代理请求url。但是,找到的响应是HttpError 302,表示不允许重定向 代码: 详细错误: HTTPError: HTTP Error 302: Found - Redirection to url 'market://details/?id=com.UCMobile.intl&referrer=utm_source%3Dhexn%40adinallBrowser%25239%26utm_content%3Dclickid%253A29lu41t486

我正在使用urllib2使用代理请求url。但是,找到的响应是HttpError 302,表示不允许重定向

代码:

详细错误:

HTTPError: HTTP Error 302: Found - Redirection to url 'market://details/?id=com.UCMobile.intl&referrer=utm_source%3Dhexn%40adinallBrowser%25239%26utm_content%3Dclickid%253A29lu41t4865766358092300dfe678d89%253Buc_trans_1%253AhiKpNb0003n190X0FH00CHdX4qZ1hm%253Bct%253A201805291855%253Bhn%253A3ddee1' is not allowed

我想你的答案是:

您使用代理处理程序,但似乎没有声明它

proxy = urllib2.ProxyHandler({'http': '127.0.0.1'})
opener = urllib2.build_opener(proxy)

好的,您声明了http、https和ftp的代理吗?URL是否用于内部URL?编辑:您的URL是否强制使用cookie?我使用luminati.io的代理。它用于http,httpsHave,您尝试使用Luminati Python示例,如?外部url请求给出相同的结果?是的,这正是我们正在使用的。不,只有一些带有market://的URL给出了这一点
proxy = urllib2.ProxyHandler({'http': '127.0.0.1'})
opener = urllib2.build_opener(proxy)