代理进行下载
import re,urllib2,time,urllib,os,sys,urllib2PROXY_INFO = { 'user' : 'l00219108', 'pass' : 'gmail.com', 'host' : 'proxy.hw.com', 'port' : 8080 }def getPage(url): proxy_support = urllib2 . ProxyHandler ( { 'http' : \ 'http://%(user)s:%(pass)s@%(host)s:%(port)d' % PROXY_INFO } ) opener = urllib2.build_opener(proxy_support,urllib2.HTTPHandler) urllib2.install_opener(opener) src = urllib2.urlopen(url) return src.read()if __name__ == '__main__': htmlAll = getPage('https://bter.com/trade/btc_cny') print htmlAll