プロクシを指定してリクエスト
>>>import urllib2 >>>req = urllib2.Request("http://www.google.co.jp") >>>req.set_proxy("proxy.example.com:8080", "http") >>>req.add_header("User-agent", "python") >>>req.add_header("Pragma", "no-cache") >>>site = urllib2.urlopen(req)
>>>import urllib2 >>>req = urllib2.Request("http://www.google.co.jp") >>>req.set_proxy("proxy.example.com:8080", "http") >>>req.add_header("User-agent", "python") >>>req.add_header("Pragma", "no-cache") >>>site = urllib2.urlopen(req)