Python Download Images Using URLs List using Requests Library

 


YouTube Video Link: Python Download Images Using URLs List using Requests Library


Python Code: 


import requests

list_urls=["https://images.pexels.com/photos/674010/pexels-photo-674010.jpeg",
          "https://images.pexels.com/photos/163036/mario-luigi-yoschi-figures-163036.jpeg",
          "https://images.pexels.com/photos/117139/pexels-photo-117139.jpeg"
          ]
for url in list_urls:
    file_name=url[url.rindex('/')+1:]
    with open(file_name, 'wb') as f:
        f.write(requests.get(url).content)

Thanks for Visiting Blinks Coders!

0 Comments

Post a Comment

Post a Comment (0)

Previous Post Next Post