From 76846eb427045357ac40071c36a992925911c409 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Tue, 24 Feb 2026 20:36:31 +0100 Subject: [PATCH] fix(mindmegette): use meal name h2 as title for alt-format pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Alt-format pages (e.g. /alapetelek/) have the meal name in an h2 element above the Hozzávalók header, which is more useful than the long article title from og:title. Co-Authored-By: Claude Opus 4.6 --- app/scraper.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/scraper.py b/app/scraper.py index fafe1ba..f0de071 100644 --- a/app/scraper.py +++ b/app/scraper.py @@ -141,6 +141,12 @@ def _parse_mindmegette(soup: BeautifulSoup, url: str) -> dict: hozz_h3 = h3 break if hozz_h3: + # Use h2 just before "Hozzávalók" as the meal name (e.g. "Salsa Roja") + prev_h2 = hozz_h3.find_previous_sibling("h2") + if prev_h2: + meal_name = prev_h2.get_text(strip=True) + if meal_name: + title = meal_name ul = hozz_h3.find_next_sibling("ul") if ul: for li in ul.find_all("li"):