From 7d6f354684f4a88a60188151f124c1d10127f1a2 Mon Sep 17 00:00:00 2001 From: Daniel Trnka Date: Mon, 5 Feb 2024 21:23:12 +0100 Subject: [PATCH] parlament: find day with text instead of date as it may contain spaces randomly --- lunches.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lunches.py b/lunches.py index 967d1d0..0f0e33d 100755 --- a/lunches.py +++ b/lunches.py @@ -282,8 +282,8 @@ def saloon_pub(dom): @restaurant("Parlament", "https://www.restauraceparlament.cz/", Location.Poruba) def parlament(dom): - today = datetime.datetime.strftime(datetime.datetime.now(), "%-d. %-m. %Y") - day = Selector(dom.css_first('.txt'), 'div div').text_contains(today) + day_nth = datetime.datetime.today().weekday() + day = Selector(dom.css_first('.txt'), 'div div').text_contains(days[day_nth]) if day: day = day.matches[0] yield Soup(day.css_first('* + dt').text())