Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 27th, 2013  |  syntax: None  |  size: 0.19 KB  |  hits: 61  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. proxy_support = urllib2.ProxyHandler({"http" : "127.0.0.1:8118"})
  2. opener = urllib2.build_opener(proxy_support)
  3. opener.addheaders = [('User-agent', 'Mozilla/5.0')]
  4. print opener.open(url).read()