Skip to content

Commit

Permalink
maangchi: fix: use regex string to find ingredients header (#1311)
Browse files Browse the repository at this point in the history
  • Loading branch information
oahnh authored Oct 22, 2024
1 parent f3c070f commit 4f86ebe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion recipe_scrapers/maangchi.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import re

from ._abstract import AbstractScraper
from ._utils import normalize_string

Expand All @@ -8,7 +10,9 @@ def host(cls):
return "maangchi.com"

def ingredients(self):
before = self.soup.find("h2", string="Ingredients").find_all_next("li")
before = self.soup.find("h2", string=re.compile(r"Ingredients")).find_all_next(
"li"
)
after = self.soup.find("h2", string="Directions").find_all_previous("li")
list_before = [normalize_string(b.get_text()) for b in before]
list_after = [normalize_string(a.get_text()) for a in after]
Expand Down

0 comments on commit 4f86ebe

Please sign in to comment.