标签:import tpc color log lib ons 百度 proc roc
import urllib2 import cookielib cookie = cookielib.CookieJar() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookie)) response = opener.open(‘http://www.baidu.com‘) for item in cookie: print ‘Name = ‘+item.name print ‘Value = ‘+item.value
运行之后就会输出访问百度的Cookie值:
标签:import tpc color log lib ons 百度 proc roc
原文地址:http://www.cnblogs.com/vhills/p/7410781.html