Skip to content

Commit

Permalink
parlament: find day with text instead of date as it may contain space…
Browse files Browse the repository at this point in the history
…s randomly
  • Loading branch information
trnila committed Feb 5, 2024
1 parent a5fd788 commit 7d6f354
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lunches.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 7d6f354

Please sign in to comment.