我有一个完整的 RIOT API 网址列表。出于某种奇怪的原因,它似乎跳过了许多 url(其中有 20 个)并且只打印了 3 个不同的 url。我做了 print(url) ,它显示了所有的 url。假设发生的是它遍历 riot API 中的每个游戏 url 并打印每个游戏中的死亡人数(总共 20 个)。相反,它发布了 3 场比赛死亡
for urls in game_list:
response=requests.get(urls)
Loop=0
while Loop<=10:
index=0
if response.json()['participantIdentities'][index]['player']['summonerName']!=sumName:
Loop= Loop+1
index=index+1
elif response.json()['participantIdentities'][index]['player']['summonerName']==sumName:
deaths.append(response.json()['participants'][index]['stats']['deaths'])
kills.append(response.json()['participants'][index]['stats']['kills'])
assists.append(response.json()['participants'][index]['stats']['assists'])
visions.append(response.json()['participants'][index]['stats']['visionScore'])
csTotal.append(response.json()['participants'][index]['stats']['totalMinionsKilled'])
print(deaths)
break