Skip to content

Instantly share code, notes, and snippets.

@aavrug
Created February 27, 2018 11:03
Show Gist options
  • Save aavrug/ecb06471886ccf15f9a3f386a805ebd8 to your computer and use it in GitHub Desktop.
Save aavrug/ecb06471886ccf15f9a3f386a805ebd8 to your computer and use it in GitHub Desktop.
Download files from URL
def get_resume():
import urllib
resumes = ['url1', 'url2']
i = 1
for resume in resumes:
name = 'Resume'+str(i)
ext = resume[-4:]
ext = ext.replace('.', '')
file = urllib.URLopener()
file.retrieve(r, "/tmp/resumes/"+name+"."+ext)
i = int(i)+1
return 'Downloaded successfully!'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment