From e07a2c28d16a370ec725fb349701ebf3b8e61724 Mon Sep 17 00:00:00 2001 From: Stijn De Clercq Date: Sun, 8 Aug 2021 23:06:59 +0200 Subject: [PATCH] Fix sporza matchday scraper --- functions/scraping.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/scraping.py b/functions/scraping.py index 6735c5c..7b642ec 100644 --- a/functions/scraping.py +++ b/functions/scraping.py @@ -54,11 +54,11 @@ def getMatchweek(): bs = BeautifulSoup(resp.text, "html.parser") matchdays = bs.find_all("section", attrs={"class": "sc-matchdays"}) - if len(matchdays) < 2: + if len(matchdays) == 0: return None # Table header - header = matchdays[1] + header = matchdays[0] # Regex to find current matchday r = re.compile(r"speeldag\s*\d+", flags=re.I)