I need to download a zipped archive from a URL and than modify it using python, I was able to do the downloading and extraction part but I came accross a little problem, the archive is uploaded monthly and its name is changed everytime, so I need to be able to change its name so I can later work with the Excel file it gives me
that is my code so far
import requests, zipfile, io
url = "https://servicos.ibama.gov.br/ctf/publico/areasembargadas/downloadListaAreasEmbargadas.php"
save_path = "C:/Users/gb2gaet"
print("user")
u = input()
print("password")
p= input()
tp = "http://" + u + ":" + p + "@10.193.33.228:8080"
proxies = {
"http": tp,
"https": tp,
}
r = requests.get(url, proxies=proxies, stream=True, verify=False )
z = zipfile.ZipFile(io.BytesIO(r.content))
z.extractall(save_path)
I tryied using this thread but it didn't work well for me since the approaches are a little bit different, or it might be that I just didn't do it right, idk