9/14/2023 0 Comments Python download file from websiteDownload a file from URL using wget in Python Hence you can see how to use the response package to download the file. We created a file named facebook.ico and have written the data into the file. We open a file in write binary mode and write the contents from the URL to the file. We use requests.get() function to send a get request to the URL link. We provided the link for the Facebook icon image. In the next line, we specified the link for the image file. In this program, we imported a requests package that handles the GET or POST requests. It will download the facebookâs favicon.ico file in your current working directory. Import requests URL = " " response = requests.get(URL) open("facebook.ico", "wb").write(ntent) Output
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |