从互联网下载zip文件的问题
import requests
url = '"file:///Users/rituraj/Downloads/fo01NOV2018bhav.csv%20(1).zip"'
# download the file contents in binary format
r = requests.get(url)
with open("/Users/rituraj/Desktop/bhavcopy/myzip.zip","wb") as zip:
zip.write(r.content)
我得到的错误:
AttributeError Traceback (most recent call last) <ipython-input-17-8b95bb6c7ef7> in <module>
3 import zipfile 4 ----> 5 urllib.urlretrieve('file:///Users/rituraj/Downloads/fo01NOV2018bhav.csv%20.zip') 6 7
# download the file contents in binary format AttributeError: module 'urllib' has no attribute 'urlretrieve'