From 0f95c0799a7efbeaf64051930a857c3cd9effc5c Mon Sep 17 00:00:00 2001 From: emkael Date: Mon, 12 Feb 2024 17:24:22 +0100 Subject: Prevent LIN bidding/play links in JFR round results from breaking reading match data --- jfr_playoff/data/match/jfrhtml.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'jfr_playoff/data') diff --git a/jfr_playoff/data/match/jfrhtml.py b/jfr_playoff/data/match/jfrhtml.py index b4a8808..a869811 100644 --- a/jfr_playoff/data/match/jfrhtml.py +++ b/jfr_playoff/data/match/jfrhtml.py @@ -77,9 +77,11 @@ class JFRHtmlMatchInfo(MatchInfoClient): carry_over = [0.0, 0.0] for i in range(0, 2): scores[i] += carry_over[i] - team_names = [[text for text in link.contents - if isinstance(text, unicode)][0].strip(u'\xa0') - for link in row.select('a[onmouseover]')] + team_names = [] + for link in row.select('a[onmouseover]'): + texts = [text for text in link.contents if isinstance(text, unicode)] + if texts: + team_names.append(texts[0].strip(u'\xa0')) for i in range(0, 2): teams[i].name = [team_names[i]] teams[i].known_teams = 1 -- cgit v1.2.3