1. When crawling the image address, when downloading the picture, the display Provisional headers are shown, will save a picture locally, but the image display is corrupted and there is no problem opening it in the browser.
2. The code is as follows:
headers = {"User-Agent":"Mozilla/5.0 (Macintosh;U;IntelMacOSX10_6_8;en-us) AppleWebKit/534.50 (KHTML,likeGecko) Version/5.1Safari/534.50"}
url =" http://www.69img.com/i/?i=u/2."
respsone = requests.get (url,headers=headers)
name = url.split (" / ") [- 1]
file_name =" br / {} ".format (name)
with open (file_name," wb ") as f:
f.write(respsone.content)
f.close()
3. This is the request header information I saw in the browser.
4. I searched for related problems on the Internet, saying that I read resources from the cache. In fact, there was no request, but there was no solution all the time. Now I want to save this picture locally. How to solve this problem without seeing the request header? Thank you in advance for your help in answering this question. Thank you very much.