This commit is contained in:
doms9 2026-04-05 12:29:27 -04:00
parent 75cc3e4bb5
commit 00000d917d

View file

@ -64,16 +64,16 @@ async def get_events(cached_keys: list[str]) -> list[dict[str, str]]:
soup = HTMLParser(html_data.content) soup = HTMLParser(html_data.content)
for card in soup.css(".section-title"): sport = None
sport = fix_league(card.text(strip=True))
node = card.next for node in soup.css(".wrapper *"):
if (cls := node.attributes.get("class")) == "section-title":
sport = fix_league(node.text(strip=True))
while node: if node.tag == "a" and cls == "match":
if node.attributes.get("class") == "section-title": if not sport:
break continue
elif node.tag == "a" and node.attributes.get("class") == "match":
if not (team_elems := node.css(".team")): if not (team_elems := node.css(".team")):
continue continue
@ -93,8 +93,6 @@ async def get_events(cached_keys: list[str]) -> list[dict[str, str]]:
} }
) )
node = node.next
return events return events