Downloading a picture via urllib and python

后端 未结 18 1317
离开以前
离开以前 2020-11-22 10:35

So I\'m trying to make a Python script that downloads webcomics and puts them in a folder on my desktop. I\'ve found a few similar programs on here that do something simila

18条回答
  •  孤街浪徒
    2020-11-22 11:09

    All the above codes, do not allow to preserve the original image name, which sometimes is required. This will help in saving the images to your local drive, preserving the original image name

        IMAGE = URL.rsplit('/',1)[1]
        urllib.urlretrieve(URL, IMAGE)
    

    Try this for more details.

提交回复
热议问题