接口地址:https://game.gtimg.cn/images/lol/act/img/js/heroList/hero_list.js?ts=2727979

接口来自官方网站,如失效自行抓包

import json
import requests

url = 'https://game.gtimg.cn/images/lol/act/img/js/heroList/hero_list.js?ts=2727979'
headers = {
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36'
}
response = requests.get(url=url, headers=headers)
dict_data = json.loads(response.text)
list_data = dict_data['hero']
for data1 in list_data:
    print('称号:'+data1['name'])
    print('姓名:'+data1['title'])
    print('音效:'+data1['selectAudio'])
    print('音效:'+data1['banAudio'])
    print('别称:'+data1['keywords'])
    print('===========================')
    print('===========================')

运行结果:

image.png

最后修改:2022 年 08 月 31 日
如果觉得我的文章对你有用,请随意赞赏