mirror of https://github.com/stijndcl/didier
Add comments
parent
7fe2689db1
commit
342db2df38
|
@ -143,6 +143,7 @@ def getTable():
|
|||
if rows is None:
|
||||
return "Er ging iets fout. Probeer het later opnieuw."
|
||||
|
||||
# Format every row to work for Tabulate
|
||||
formatted = [_formatRow(row) for row in rows]
|
||||
|
||||
header = "Jupiler Pro League Klassement"
|
||||
|
@ -156,6 +157,8 @@ 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]
|
||||
|
||||
# Insert the team name into the list
|
||||
scoresArray.insert(1, row.find_all("a")[0].renderContents().decode("utf-8").split("<!--")[0])
|
||||
|
||||
return scoresArray
|
||||
|
|
|
@ -97,6 +97,7 @@ def getJPLTable():
|
|||
"""
|
||||
page_html = get("https://sporza.be/nl/categorie/voetbal/jupiler-pro-league/")
|
||||
|
||||
# Something went wrong
|
||||
if page_html.status_code != 200:
|
||||
return None
|
||||
|
||||
|
|
Loading…
Reference in New Issue