custom scraper fails safe

This commit is contained in:
smilerz
2021-04-15 13:17:15 -05:00
parent d0cedaf7a1
commit d814d13d54
3 changed files with 22 additions and 37 deletions

View File

@@ -44,11 +44,12 @@ class CooksIllustrated(AbstractScraper):
def instructions(self):
if not self.recipe:
self.get_recipe()
return "\n".join([self.recipe['whyThisWorks']] +
[
instruction['fields']['content']
for instruction in self.recipe['instructions']
]
return "\n".join(
[self.recipe['whyThisWorks']]
+ [
instruction['fields']['content']
for instruction in self.recipe['instructions']
]
)
def nutrients(self):