Spaces:
Runtime error
Runtime error
Update app.py
Browse files4 unmodified lines56788910111213910111213141516171819204 unmodified linesimport urllib
def download_file(url, local_filename): try: with requests.get(url, stream=True) as r: r.raise_for_status() with open(local_filename, 'wb') as f: for chunk in r.iter_content(chunk_size=8192): f.write(chunk) return local_filename with requests.get(url, stream=True) as r: r.raise_for_status() with open(local_filename, 'wb') as f: for chunk in r.iter_content(chunk_size=8192): f.write(chunk) return local_filename except requests.exceptions.HTTPError as err: print(f"HTTP error occurred: {err}") # or use logging
def download_html_and_files(url): html_content = requests.get(url).textapp.py+10-6