Skip to content

Instantly share code, notes, and snippets.

@joetde
Created April 2, 2015 08:35
Show Gist options
  • Save joetde/ad802bd881555aebecf7 to your computer and use it in GitHub Desktop.
Save joetde/ad802bd881555aebecf7 to your computer and use it in GitHub Desktop.
import urllib2
import cookielib
from pprint import pprint
cookies = cookielib.LWPCookieJar()
handlers = [
urllib2.HTTPHandler(),
urllib2.HTTPSHandler(),
urllib2.HTTPCookieProcessor(cookies)
]
opener = urllib2.build_opener(*handlers)
html = opener.open("...").read()
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment