##################
import requests
import os
###################### The address of the file you want to download
url = “”
#############################
root = “D://download//”
path = root + url.split(’/’)[-1]
try:
if not os.path.exists(root):
os.mkdir(root)
if not os.path.exists(path):
r = requests.get(url)
with open(path,‘wb’) as f:
f.write(r.content)
f.close()
print(“file save successful”)
else:
print(“file exists”)
except:
print(“spider failed”)