import requests
import json
resp = requests.get('https://pvp.qq.com/web201605/js/herolist.json')
heros_list = json.loads(resp.text)
for hero in heros_list:
id = hero['ename']
name = hero['cname']
skin_url = 'https://game.gtimg.cn/images/yxzj/img201606/skin/hero-info/'+str(id)+'/'+str(id)+'-bigskin-1.jpg'
pic = requests.get(skin_url).content
with open('skin/' + name + '.jpg', "wb") as heroload:
heroload.write(pic)
print("当前英雄" + name + " 皮肤图片爬取成功!")
转载请注明原文地址:https://blackberry.8miu.com/read-27827.html