我尝试下载这个CSV数据集 https://public.opendatasoft.com/explore/dataset/sirene_v3
我尝试了Wifi和以太网13Mb向下连接,它做同样的事情:它停止在1或2GB左右。我还尝试用Python直接在服务器上(通过Zoe平台)下载它,但它也停止了,我也尝试了分块下载,但仅此而已。你知道吗
我试过:
urllib.request.urlretrieve(url, 'csv.csv')
我也试过这个:
response = requests.get(url, stream=True)
handle = open(target_path, "wb")
for chunk in response.iter_content(chunk_size=512):
if chunk:
handle.write(chunk)
使用请求和chunking
没有错误,下载会停止,就好像它是完成的一样
如果你有linux,你可以尝试通过wget下载数据集
用法:wget url
或者对于该数据集csv:wgethttps://public.opendatasoft.com/explore/dataset/sirene_v3/download/?format=csv&timezone=Europe/Paris&use_labels_for_header=true
如果连接中断,您可以使用wget-c url恢复连接
资料来源: https://www.garron.me/en/bits/wget-resume-continue-broken-download.html
相关问题 更多 >
编程相关推荐