此處以下載html免費的素材為例:
PS.檔案會下載在您python檔案下的銅個資料夾:如果你把此檔案存在桌面,那檔案也會下載在桌面
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib.request | |
import time | |
for i in range (100): | |
a = input("請輸入此素材的名稱,全部小寫,不能多打任何一個字元,包括空格,且請切換到半形:\n") | |
print("現在時間是{},現在我正在下載{}的素材,請稍等".format(time.strftime("%H:%M:%S"),a)) | |
urllib.request.urlretrieve("https://templated.co/{}/download".format(a),"{}.zip".format(a)) | |
hhh = input("quit?") | |
if (hhh == y): | |
quit() | |
else: | |
quit() |
留言
張貼留言