From 8f766ba7af67d8ee5e8b135d209cfaeaba3ba735 Mon Sep 17 00:00:00 2001 From: socks Date: Wed, 14 Jun 2017 21:46:40 +0100 Subject: [PATCH] Updated top5teams func for new site layout (rest coming soon) --- main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 7704035..2caa57d 100644 --- a/main.py +++ b/main.py @@ -11,9 +11,9 @@ def top5teams(): home = get_parsed_page("http://hltv.org/") count = 0 teams = [] - for team in home.find_all("div", {"class": "vsbox", })[:5]: + for team in home.find_all("div", {"class": ["col-box rank"], }): count += 1 - teamname = team.find_all("div")[2].text.strip() + teamname = team.text[3:] teams.append(teamname) return teams @@ -210,4 +210,4 @@ def get_results(): if __name__ == "__main__": import pprint pp = pprint.PrettyPrinter() - pp.pprint(get_results()) + pp.pprint(top5teams())