Advertisement
Guest User

get_cookie

a guest
Oct 31st, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. import sys
  2. import cookielib, urllib2
  3. my_url = 'http://doctormo.deviantart.com/art/Gimp-2-8-Photoshop-Tweaks-432736644'
  4. def get_cookie(url):
  5.     cj = cookielib.CookieJar()
  6.     opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
  7.     home = opener.open('http://doctormo.deviantart.com/art/Gimp-2-8-Photoshop-Tweaks-432736644')
  8.     print cj._cookies['.deviantart.com']['/']['userinfo'].value
  9.     print ""
  10.     print cj
  11.    
  12.  
  13. if __name__ == "__main__":
  14.     get_cookie(my_url)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement