代码如下:importrequestsmi_requests=requests.Session()response_first=mi_requests.get(url=login_url_first,headers=login_header_first)printresponse_first.request.headersprintresponse_first.cookies['JSESSIONID']response_second=mi_requests.get(url=login_url_second)printresponse_second.request.headers返回信息:第一个print{'Accept-Language':'zh-CN,zh;q=0.9','Accept-Encoding':'gzip,deflate','Host':'e.mi.com','Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8','User-Agent':'Mozilla/5.0(WindowsNT10.0;WOW64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/65.0.3325.146Safari/537.36','Connection':'keep-alive','Upgrade-Insecure-Requests':'1'}第二个PrintaaaeKLWkeCfZWhAGOF_iw第三个Print{'Connection':'keep-alive','Accept-Encoding':'gzip,deflate','Accept':'*/*','User-Agent':'python-requests/2.18.4'}session实例化,为什么不携带http头信息了?
梵蒂冈之花
摇曳的蔷薇
随时随地看视频慕课网APP
相关分类