Skip to content

Instantly share code, notes, and snippets.

@takaki
Created October 3, 2012 10:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takaki/3826270 to your computer and use it in GitHub Desktop.
Save takaki/3826270 to your computer and use it in GitHub Desktop.
HTTPS connection with urllib2
#!/usr/bin/python
import urllib2
proxy_handler = urllib2.ProxyHandler({'https': 'http://localhost:8888/'})
opener = urllib2.build_opener(proxy_handler)
print opener.open("https://www.google.com/").read()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment