def installCookie(self):
if self.__opener is None:
self.__cookies = cookielib.CookieJar()
proxy_support= None
if self.__proxyIp is not None:
proxy_support = urllib.request.ProxyHandler(self.__proxyIp)
self.__opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(self.__cookies),proxy_support)
else:
self.__opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(self.__cookies))
urllib2.install_opener(self.__opener)
评论列表
文章目录