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:
parent
eb0c02a5f8
commit
d5403101a9
1 changed files with 8 additions and 1 deletions
9
main.py
9
main.py
|
@ -45,6 +45,13 @@ def top20teams():
|
||||||
return teamlist
|
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():
|
def getmatches():
|
||||||
matches = get_parsed_page("http://www.hltv.org/matches/")
|
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())
|
print(match.text[:7].strip(), match.text[7:-7].strip())
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
print(top20teams())
|
topplayers()
|
||||||
|
|
Loading…
Add table
Reference in a new issue