From 4614145df6fb870e8229d27ce317a52df6e40507 Mon Sep 17 00:00:00 2001 From: Stijn De Clercq Date: Mon, 8 Feb 2021 18:59:05 +0100 Subject: [PATCH] Add goal difference to jpl table Fixes #33 --- functions/football.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/football.py b/functions/football.py index de1fa78..64941ad 100644 --- a/functions/football.py +++ b/functions/football.py @@ -147,7 +147,7 @@ def getTable(): formatted = [_formatRow(row) for row in rows] header = "Jupiler Pro League Klassement" - table = tabulate.tabulate(formatted, headers=["#", "Ploeg", "Punten", "M", "M+", "M-", "M="]) + table = tabulate.tabulate(formatted, headers=["#", "Ploeg", "Punten", "M", "M+", "M-", "M=", "D+", "D-", "D+/-"]) return "```{}\n\n{}```".format(header, table) @@ -156,7 +156,7 @@ def _formatRow(row): """ Function that formats a row into a list for Tabulate to use """ - scoresArray = list([td.renderContents().decode("utf-8") for td in row.find_all("td")])[:6] + scoresArray = list([td.renderContents().decode("utf-8") for td in row.find_all("td")])[:9] # Insert the team name into the list scoresArray.insert(1, row.find_all("a")[0].renderContents().decode("utf-8").split("