python3 读取JSESSIONID方法

python3 中将cookielib模块合并到html模块中

加载模块 

import.http.cookiejar

是使用变量 http.cookiejar.CookieJar() 获取

import urllib,urllib.request,urllib.parse
import http.cookiejar
url='http://www.xxxx.com/8a96ee'
req = urllib.request.Request(url,)
cj = http.cookiejar.CookieJar()

opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj))
r = opener.open(req)

 

posted on 2017-04-07 11:35  蓝码骑士  阅读(1015)  评论(0)    收藏  举报

导航