mirror of https://github.com/stijndcl/didier
Fix sporza matchday scraper
parent
500da97b8b
commit
e07a2c28d1
|
@ -54,11 +54,11 @@ def getMatchweek():
|
||||||
bs = BeautifulSoup(resp.text, "html.parser")
|
bs = BeautifulSoup(resp.text, "html.parser")
|
||||||
matchdays = bs.find_all("section", attrs={"class": "sc-matchdays"})
|
matchdays = bs.find_all("section", attrs={"class": "sc-matchdays"})
|
||||||
|
|
||||||
if len(matchdays) < 2:
|
if len(matchdays) == 0:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# Table header
|
# Table header
|
||||||
header = matchdays[1]
|
header = matchdays[0]
|
||||||
|
|
||||||
# Regex to find current matchday
|
# Regex to find current matchday
|
||||||
r = re.compile(r"speeldag\s*\d+", flags=re.I)
|
r = re.compile(r"speeldag\s*\d+", flags=re.I)
|
||||||
|
|
Loading…
Reference in New Issue