Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
# coding: utf-8
import urllib
import urllib2
reg_nos = [16738, 17288, 18162, 18776, 18868, 19116, 19223, 19505];
pdf_url = ''
def fetch_url(url):
return urllib2.urlopen(url).read()
def save_url_as_file(url, filename):
def download_pdf(reg_no):
f = '%d.pdf' % reg_no
save_url_as_file(pdf_url % reg_no, f)
print "\t- %s downloaded" % f
# tests
def single(regs):
for u in regs:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment