Skip to content

Commit

Permalink
Fix ingredients for simplyrecipes.com scraper (#623)
Browse files Browse the repository at this point in the history
  • Loading branch information
puradox committed Oct 9, 2022
1 parent ca8720a commit c477678
Show file tree
Hide file tree
Showing 3 changed files with 1,826 additions and 1,480 deletions.
6 changes: 4 additions & 2 deletions recipe_scrapers/simplyrecipes.py
Expand Up @@ -28,7 +28,9 @@ def yields(self):
)

def ingredients(self):
ingredients = self.soup.find("ul", {"class": "ingredient-list"}).findAll("li")
ingredients = self.soup.find(
"ul", {"class": "structured-ingredients__list"}
).findAll("li")

return [normalize_string(ingredient.get_text()) for ingredient in ingredients]

Expand All @@ -40,7 +42,7 @@ def instructions(self):
return "\n".join(
[
normalize_string(
step.div.text + ": " + "".join([p.text for p in step.findAll("p")])
step.div.text + "".join([p.text for p in step.findAll("p")])
)
for step in steps
]
Expand Down

0 comments on commit c477678

Please sign in to comment.