http://blog.csdn.net/samxx8/article/details/21535901
1.获取cookie
import urllib
import http.cookiejar
cookie = http.cookiejar.CookieJar()
opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cookie))
response = opener.open(‘http://www.weibo.com‘)
for item in cookie:
print (‘Name = ‘+item.name)
print (‘Value = ‘+item.value)
时间: 2024-11-06 14:35:27