如何使用登录请求从网站下载图像?

时间:2016-11-05 07:46:28

标签: python image session web-scraping python-requests

我在请求中使用会话 -

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文件。我怎么能这样做?

0 个答案:

没有答案