Skip to content

Commit

Permalink
Raise exceptions on not found instructions & ingredents
Browse files Browse the repository at this point in the history
  • Loading branch information
jaapio committed Oct 3, 2023
1 parent 098da0c commit f1a4893
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions recipe_scrapers/keukenliefdenl.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# mypy: allow-untyped-defs
from ._abstract import AbstractScraper
from ._exceptions import ElementNotFoundInHtml
from ._utils import get_minutes, get_yields, normalize_string


Expand Down Expand Up @@ -46,7 +47,7 @@ def ingredients(self):
)

# Nothing found, we give up.
return []
raise ElementNotFoundInHtml("Could not find ingredients.")

def process_ingredients(self, container):
ingredients = container.findChildren("li")
Expand All @@ -70,7 +71,7 @@ def instructions(self):
+ instructions_heading.parent.find_next_siblings("p")
)

return ""
raise ElementNotFoundInHtml("Could not find instructions.")

def normalize_instructions(self, instructions):
instructions = [
Expand Down

0 comments on commit f1a4893

Please sign in to comment.