Chat: chenjin706487
@file: .py
@time: 2020/1/1 21:33
‘’’
import os
import requests
url=‘https://pvp.qq.com/web201605/js/herolist.json’
re=requests.get(url=url).json()
print(re)
num_list=list(map(lambda x:x[‘ename’],re))
name_list=list(map(lambda x:x[ ‘cname’],re))
x = 105
for i in name_list:
try:
os.mkdir(‘D:\图片\英雄联盟\’ + i)
except FileExistsError:
os.chdir(‘D:\图片\英雄联盟\’ + i)
for a in range(4):
big_sign_url=r’https://game.gtimg.cn/images/yxzj/img201606/skin/hero-info/{}/{}-bigskin-{}.jpg’.format(str(x),str(x),str(a))
ret=requests.get(big_sign_url)
if ret.status_code==200:
with open(’%s%s.jpg’%(i,a),‘wb’) as f:
f.write(ret.content)
x+=1
![每个文件里面的大图片
相关文章: