Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Using urllib2 and cookielib to print cookies from GET request
import urllib2
import cookielib
cookie_jar = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookie_jar))
request = urllib2.Request('')
for cookie in cookie_jar:
print cookie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment