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 <noreply@anthropic.com>
This commit is contained in:
2026-02-24 16:41:29 +01:00
parent 73a2319f5a
commit 00b097566a
+4 -1
View File
@@ -354,8 +354,11 @@ 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"):
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)