import osimport urllib2import cookielibfrom urllib2 import urlopen, RequestcookieFile = "cookies.dat"testURL = 'http://maps.google.com/'cJar = cookielib.LWPCookieJar()opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cJar))urllib2.install_opener(opener)r = Request(testURL)h = urlopen(r)print h.info()for ind, cookie in enumerate(cJar): print "%d - %s" % (ind, cookie)cJar.save(cookieFile)
Name (required)
email (will not be published) (required)
Website