爬取王者荣耀英雄图片代码

    科技2023-11-12  105

    #-*- codeing = utf-8 -*- #@Time : 2020/10/6 23:05 #@Author : dualseason #@File : pink_catch.py #@Software : PyCharm 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 + " 皮肤图片爬取成功!")
    Processed: 0.015, SQL: 8