From 00b097566a37a0ee56e2528992b1f94c11ef8705 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Tue, 24 Feb 2026 16:41:29 +0100 Subject: [PATCH] Fix nosalty tag extraction: scope to recipe attribute list The m-tags__tagItem class is used site-wide for SEO/navigation links. Scope tag extraction to div.p-recipe__attributeList to only get actual recipe tags. Co-Authored-By: Claude Opus 4.6 --- app/scraper.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/scraper.py b/app/scraper.py index a2a8547..4aa506f 100644 --- a/app/scraper.py +++ b/app/scraper.py @@ -354,11 +354,14 @@ def _parse_nosalty(soup: BeautifulSoup, url: str) -> dict: instructions.append(txt) # --- Tags --- + # Scoped to div.p-recipe__attributeList to avoid site-wide SEO tags. tags = [] - for a in soup.find_all("a", class_="m-tags__tagItem"): - tag_text = a.get_text(strip=True) - if tag_text: - tags.append(tag_text) + attr_list = soup.find("div", class_="p-recipe__attributeList") + if attr_list: + for a in attr_list.find_all("a", class_="m-tags__tagItem"): + tag_text = a.get_text(strip=True) + if tag_text: + tags.append(tag_text) return { "title": title or "Ismeretlen recept",