Skip to content

Commit

Permalink
Fix lecker.de articles (#611)
Browse files Browse the repository at this point in the history
  • Loading branch information
vabene1111 authored and jayaddison committed Dec 16, 2022
1 parent 2424abc commit 5606a13
Show file tree
Hide file tree
Showing 5 changed files with 2,522 additions and 473 deletions.
19 changes: 17 additions & 2 deletions recipe_scrapers/lecker.py
Expand Up @@ -12,7 +12,16 @@ def author(self):
return self.schema.author()

def title(self):
return self.schema.title()
try:
return self.schema.title()
except TypeError:
return (
self.soup.find(
"header", {"class": "article-header article-header--article"}
)
.find("h1")
.get_text()
)

def category(self):
return self.schema.category()
Expand All @@ -36,7 +45,13 @@ def ingredients(self):
return self.schema.ingredients()

def instructions(self):
return self.schema.instructions()
if self.schema.instructions():
return self.schema.instructions()
else:
divs = self.soup.find_all("div", {"class": "js-quizToggle"})
for d in divs:
if d.find("span", "article__shifted-jump-label"):
return d.get_text()

def ratings(self):
return self.schema.ratings()
Expand Down

0 comments on commit 5606a13

Please sign in to comment.