Import Urllib.request
Import JSON
Import OS
Save_dir ="D:\ League of Legends Skin"
If not os.path.exists (Save_dir):
Os.mkdir (Save_dir)
For IInchRange99,143):
For CNTInchRange0,9):
#save_file_name = "D:\ League of Legends skin \ \" +str (hero_json[i][' ename ') + '-' + hero_json[i][' cname '] + '-' + skin_name[cnt] + '. jpg '
Save_file_name ="D:\ League of Legends Skin\\" +STR (i) +' 00 ' +STR (CNT) +'. jpg '
#http://ossweb-img.qq.com/images/lol/web201310/skin/big143000.jpg
Skin_url =' Http://ossweb-img.qq.com/images/lol/web201310/skin/big ' +STR (i) +str (CNT) +". jpg '
print ( "Downloading%d pictures ..."% i)
print ( Skin_url)
if not Os.path.exists (save_file_name):
try:
Urllib.request.urlretrieve (skin_url,save_file_name)
except:
continue #发生异常仍继续
print ( "Picture Download complete ...)
Python download League of Legends Skin Pictures