Python 标准库 urllib2 的使用细节
import urllib2?httpHandler = urllib2.HTTPHandler(debuglevel=1)httpsHandler = urllib2.HTTPSHandler(debuglevel=1)opener = urllib2.build_opener(httpHandler, httpsHandler)?urllib2.install_opener(opener)response = urllib2.urlopen('http://www.google.com')?
?
转自:http://apps.hi.baidu.com/share/detail/23498106