1
0
Fork 0
mirror of https://github.com/SocksPls/hltv-api synced 2025-07-12 03:59:15 +00:00

Updated top5teams func for new site layout (rest coming soon)

This commit is contained in:
socks 2017-06-14 21:46:40 +01:00
parent dd4bece7a7
commit 8f766ba7af

View file

@ -11,9 +11,9 @@ def top5teams():
home = get_parsed_page("http://hltv.org/") home = get_parsed_page("http://hltv.org/")
count = 0 count = 0
teams = [] teams = []
for team in home.find_all("div", {"class": "vsbox", })[:5]: for team in home.find_all("div", {"class": ["col-box rank"], }):
count += 1 count += 1
teamname = team.find_all("div")[2].text.strip() teamname = team.text[3:]
teams.append(teamname) teams.append(teamname)
return teams return teams
@ -210,4 +210,4 @@ def get_results():
if __name__ == "__main__": if __name__ == "__main__":
import pprint import pprint
pp = pprint.PrettyPrinter() pp = pprint.PrettyPrinter()
pp.pprint(get_results()) pp.pprint(top5teams())