我在请求中使用会话 -
payload ={ 'email':'xy@xyz.com', 'pass':'123'}
imgurl = 'http://erp.sangamuniversity.ac.in/Student/showimage.aspx?id=24218'
with session() as c:
c.post('http://erp.sangamuniversity.ac.in/Default1.aspx', data=payload)
response = c.get(imgurl)
f = open("img.jpg", "w+")
f.write(response)
但它没有将图像从img url保存到所需的img.jpg文件。我怎么能这样做?