我在某处读到当前 urllib2 不支持经过身份验证的 https 连接。我的代理仅使用基本身份验证,但如何通过它打开基于 https 的网页。请帮我。
谢谢。
我在某处读到当前 urllib2 不支持经过身份验证的 https 连接。我的代理仅使用基本身份验证,但如何通过它打开基于 https 的网页。请帮我。
谢谢。
“urllib2 不支持经过身份验证的 https 连接”错误。
# Build Handler to support HTTP Basic Authentication...
basic_handler = urllib2.HTTPBasicAuthHandler()
basic_handler.add_password(realm, self.urlBase, username, password)
# Get cookies, also, to handle login
self.cookies= cookielib.CookieJar()
cookie_handler= urllib2.HTTPCookieProcessor( self.cookies )
# Assemble the final opener
opener = urllib2.build_opener(basic_handler,cookie_handler)