Skip to content

Instantly share code, notes, and snippets.

@harendra21
Created May 19, 2022 11:45
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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