美文网首页工作生活
fetch google arts and culture sm

fetch google arts and culture sm

作者: 狼无雨雪 | 来源:发表于2019-07-05 12:54 被阅读0次
import urllib.request
import os
import time
path = "Ukiyo_download"
if not os.path.exists(path):
    os.makedirs(path)


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

相关文章

网友评论

    本文标题:fetch google arts and culture sm

    本文链接:https://www.haomeiwen.com/subject/gszrhctx.html