Skip to content

Instantly share code, notes, and snippets.

@wklm
Created March 11, 2017 17:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wklm/c615e7d5eb3422fae6ae7bd3090b4a3a to your computer and use it in GitHub Desktop.
Save wklm/c615e7d5eb3422fae6ae7bd3090b4a3a to your computer and use it in GitHub Desktop.
import wget
import time
from datetime import date, timedelta
dmy = 20170424
while True:
try:
t=time.strptime(str(dmy),'%Y%m%d')
newdate=date(t.tm_year,t.tm_mon,t.tm_mday)+timedelta(1)
url = 'http://www.wst.univie.ac.at/~wanek/dbsprf/dbs_vo_' + str(newdate.strftime('%Y%m%d')) + '.pdf'
try:
filename = wget.download(url)
print('pobralo sie' + str(newdate.strftime('%Y%m%d')))
except:
print('nie' + str(newdate.strftime('%Y%m%d')))
except:
pass
dmy -= 1
if dmy < 20110531:
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment