I have a following problem. I want to download a zip file. See a following code:
import os
import requests
import time
url = "https://kriminalita.policie.cz/api/v1/downloads/202011.csv.zip"
name = url.split("/")[-1]
response = requests.get(url)
with open(os.path.join(r'C:\Users\misak\Desktop\LD_save\stazene', name), 'w') as f:
f.write(str(response.content))
The zip file seems to be downloaded, however I am not able to open it, because "is either in unknown format or damaged". But when I put my url into Chrome and try it manually I am able to open the zip file in WinRAR. Can you help me, please?