cookielib是一个用于处理客户端HTTP cookie的模块
https://docs.python.org/2/library/cookielib.html?highlight=cookielib#cookielib
In [191]: import cookielib,urllib2 In [192]: cj=cookielib.CookieJar() In [193]: openner=urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) In [194]: r=openner.open("http://www.baidu.com/")