Skip to content

Instantly share code, notes, and snippets.

@harendra21
Created May 19, 2022 11:45
Embed
What would you like to do?
import urllib.request
def download(tutorialName):
url = 'https://www.tutorialspoint.com/' + tutorialName + '/' + tutorialName + '_tutorial.pdf'
downloadLocation = '<location>'
pdf = urllib.request.urlopen(url)
saveFile = open(downloadLocation + tutorialName + '.pdf', 'wb')
saveFile.write(pdf.read())
saveFile.close()
if __name__ == '__main__':
tutorialName = input('Name of the pdf to be downloaded: ')
download(tutorialName)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment