工作生活

fetch huaban small images from u

2019-07-05  本文已影响0人  狼无雨雪
import urllib.request
import os
path = "huaban_download"
if not os.path.exists(path):
    os.makedirs(path)


with open("huaban_img_asserts_all.txt",'r',encoding="utf8") as read_file:
    for index, line in enumerate(read_file.readlines()):
        url = "http:" + line.strip()
        print(index, url)
        file_name = path + "/" +str(url.split("/")[-1]) + ".png"
        urllib.request.urlretrieve(url, filename = file_name)
上一篇下一篇

猜你喜欢

热点阅读