diff options
author | emkael <emkael@tlen.pl> | 2024-02-12 17:24:22 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2024-02-12 17:24:22 +0100 |
commit | 0f95c0799a7efbeaf64051930a857c3cd9effc5c (patch) | |
tree | 4e8529469535a3deeb1d19eddebb1f2c913212b7 /jfr_playoff | |
parent | 874391bc1574333337fefbc7abff06011cbff74c (diff) |
Prevent LIN bidding/play links in JFR round results from breaking reading match data
Diffstat (limited to 'jfr_playoff')
-rw-r--r-- | jfr_playoff/data/match/jfrhtml.py | 8 |
1 files changed, 5 insertions, 3 deletions
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 |