url =‘XXX‘
cookies ={"id":"123456"}
res =requests.get(url,cookies=cookies)
if res.status_code == 200:
#写入文件
with open(‘F:\\script\\download\\test_05.zip‘, ‘wb‘) as f:
for chunk in res.iter_content(chunk_size=1024): #循环读取信息,iter_content:流下载,边下载边存储在硬盘;chunk_size:文件大小
f.write(chunk) #将循环读取的信息,写入到test_05.zip里面