fetch google arts and culture sm
2019-07-05 本文已影响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)