batch downloading file in python

import urllib.request
 
url_prefix = 'http://nptel.ac.in/courses/111103021/'

for i in range(1,42):
    url = url_prefix + str(i)
    print("downloading page " + str(i))
    urllib.request.urlretrieve(url, str(i) + ".pdf")

你可能感兴趣的:(batch downloading file in python)