1
0
Fork 0
mirror of https://github.com/SocksPls/hltv-api synced 2025-04-30 15:43:07 +00:00

Updated top_players to get team name

This commit is contained in:
SecretlyTaco 2016-09-13 01:37:15 +01:00
parent 30404fbd8f
commit 27d0785ddb

View file

@ -56,6 +56,7 @@ def top_players():
player = {} player = {}
player_link = player_elem.find('a') player_link = player_elem.find('a')
player['name'] = player_link.text player['name'] = player_link.text
player['team'] = player_elem.text.split("(")[1].split(")")[0]
p_url = player_link['href'] p_url = player_link['href']
player['player-id'] = converters.to_int(p_url[p_url.index('playerid=')+9:p_url.index('&statsfilter')]) player['player-id'] = converters.to_int(p_url[p_url.index('playerid=')+9:p_url.index('&statsfilter')])
player['stat'] = player_elem.select('div:nth-of-type(2)')[0].text player['stat'] = player_elem.select('div:nth-of-type(2)')[0].text