From 530d873f4f95e9e3cdbc25700c029afbbc2ba280 Mon Sep 17 00:00:00 2001 From: miztch Date: Wed, 7 Jun 2023 01:05:10 +0900 Subject: [PATCH] fix best_of type and deal with 'N maps' --- functions/sasha/index.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/functions/sasha/index.py b/functions/sasha/index.py index d05abc3..16850bb 100644 --- a/functions/sasha/index.py +++ b/functions/sasha/index.py @@ -115,7 +115,9 @@ def scrape_match(match_url_path): teams = [t.text().replace('\t', '').replace('\n', '') for t in teams] best_of = html.css('.match-header-vs-note')[-1].text() - best_of = best_of.replace('Bo', '').replace('\t', '').replace('\n', '') + best_of = best_of.replace('Bo', '').replace(' Maps', '') + best_of = best_of.replace('\t', '').replace('\n', '') + best_of = int(best_of) event_url_path = html.css_first('a.match-header-event').attributes['href']