Spaces:
Runtime error
Runtime error
Update app.py
Browse files4 unmodified lines56789101112131415164 unmodified linesimport urllibdef download_file(url, 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_filenamedef download_html_and_files(url):html_content = requests.get(url).text4 unmodified lines5678910111213141516171819204 unmodified linesimport urllibdef 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_filenameexcept requests.exceptions.HTTPError as err:print(f"HTTP error occurred: {err}") # or use loggingdef download_html_and_files(url):html_content = requests.get(url).text
app.py+10-6