Skip to content

Instantly share code, notes, and snippets.

@harendra21
Created May 19, 2022 11:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harendra21/d2ac99e33f97675e352eff3efcc0ac92 to your computer and use it in GitHub Desktop.
Save harendra21/d2ac99e33f97675e352eff3efcc0ac92 to your computer and use it in GitHub Desktop.
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