Created
May 19, 2022 11:45
-
-
Save harendra21/d2ac99e33f97675e352eff3efcc0ac92 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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