Created
June 3, 2013 10:15
-
-
Save brijeshb42/5697293 to your computer and use it in GitHub Desktop.
spoj pdf downloader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2,os | |
os.system('cls') | |
print 'SPOJ problem pdf downloader' | |
url = 'http://www.spoj.com/problems/' | |
print 'Enter problem code' | |
prblm = raw_input() | |
prblm = prblm.upper() | |
url = url + prblm +'.pdf' | |
print 'Downloading '+url | |
pdf = urllib2.urlopen(url) | |
#if int(pdf.info().getheader('Content-Length').strip())<=10: | |
# print 'Error downloading '+prblm | |
# exit() | |
output = open(prblm+'.pdf','wb') | |
output.write(pdf.read()) | |
pdf.close() | |
print 'Done' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey, thanks. I added bulk download from username