URL http://www.example.com/downloads/?latest=rcm®ion=GB每天返回一个新文件:例如“ GB_010_2019031212.nc”
我希望python下载文件并使用默认名称保存。 使用此代码,我需要重命名文件。
import requests
url = 'http://www.example.com/downloads/?latest=rcm®ion=GB'
myfile = requests.get(url, allow_redirects=True)
open('hello.nc', 'wb').write(myfile.content)