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

fix docefactor

This commit is contained in:
CAíque - 2022-08-14 01:37:45 -03:00
parent 54dc744189
commit 4b6cde2cf6

12
main.py
View file

@ -332,22 +332,22 @@ def _get_matches_by_team(table):
matches = [] matches = []
for i, event in enumerate(events): for i, event in enumerate(events):
event_name = event.find("a", {"class": "a-reset"}).text event_name = event.find("a", {"class": "a-reset"}).text
rows = event_matches[i]("tr", {"class": "team-row"}) rows = event_matches[i]("tr", {"class": "team-row"})
for row in rows[0:len(rows)]: for row in rows[0:len(rows)]:
match = {} match = {}
match['date'] = row.find( match['date'] = row.find(
"td", {"class": "date-cell"}).find("span").text "td", {"class": "date-cell"}).find("span").text
match['teams'] = {} match['teams'] = {}
match['teams']["team_1"] = row.find( match['teams']["team_1"] = row.find(
"td", {"class": "team-center-cell"}).find("a", {"class": "team-name team-1"}).text "td", {"class": "team-center-cell"}).find("a", {"class": "team-name team-1"}).text
match['teams']["team_1_id"] = row.find( match['teams']["team_1_id"] = row.find(
"td", {"class": "team-center-cell"}).find("a", {"class": "team-name team-1"})['href'].split('/')[2] "td", {"class": "team-center-cell"}).find("a", {"class": "team-name team-1"})['href'].split('/')[2]
match['teams']["team_2"] = row.find( match['teams']["team_2"] = row.find(
"td", {"class": "team-center-cell"}).find("a", {"class": "team-name team-2"}).text "td", {"class": "team-center-cell"}).find("a", {"class": "team-name team-2"}).text
match['teams']["team_2_id"] = row.find( match['teams']["team_2_id"] = row.find(
"td", {"class": "team-center-cell"}).find("a", {"class": "team-name team-2"})['href'].split('/')[2] "td", {"class": "team-center-cell"}).find("a", {"class": "team-name team-2"})['href'].split('/')[2]
match["confront_name"] = match['teams']["team_1"] + \ match["confront_name"] = match['teams']["team_1"] + \
" X " + match['teams']["team_2"] " X " + match['teams']["team_2"]
match["championship"] = event_name match["championship"] = event_name