1
0
Fork 0
mirror of https://github.com/SocksPls/hltv-api synced 2025-05-02 08:09:36 +00:00

Added function to get top 5 players in each category. Not yet formatted to JSON/Dict

This commit is contained in:
SecretlyTaco 2016-09-12 17:16:46 +01:00
parent eb0c02a5f8
commit d5403101a9

View file

@ -45,6 +45,13 @@ def top20teams():
return teamlist
def topplayers():
page = get_parsed_page("http://www.hltv.org/?pageid=348&statsfilter=10&mapid=0")
boxes = page.find_all("div", {"class": "framedBox"})
for box in boxes:
print(box.find("h2").text)
for player in box.find_all("div", {"style":["background-color: #E8E8E8;;padding:5px;", ";padding:5px;"]}):
print "* ", player.text.replace(")", ") ")
def getmatches():
matches = get_parsed_page("http://www.hltv.org/matches/")
@ -62,4 +69,4 @@ def getmatches():
print(match.text[:7].strip(), match.text[7:-7].strip())
if __name__ == "__main__":
print(top20teams())
topplayers()