Answer the question
In order to leave comments, you need to log in
Why do you overwrite when downloading a CSV file?
import requests
link = 'https://dsa.court.gov.ua/open_data_json.php?json=532'
response = requests.get(link).json()
urls = []
for item in response['Файли']:
urls.append(list(item.values())[0])
for url in urls:
with requests.get(url, stream=True) as response:
response.raise_for_status()
with open("1data_sit.csv", "wb") as file:
for chunk in response.iter_content(chunk_size=8192):
file.write(chunk)
file.flush()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question