From 7930c2417c3f3a8bcbc070b6ebe12e8cefb8af33 Mon Sep 17 00:00:00 2001 From: smilerz Date: Sat, 17 Apr 2021 17:12:43 -0500 Subject: [PATCH] update ATK scrape to handle empty headnote --- cookbook/helper/scrapers/cooksillustrated.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cookbook/helper/scrapers/cooksillustrated.py b/cookbook/helper/scrapers/cooksillustrated.py index 0318ac9c..56d91826 100644 --- a/cookbook/helper/scrapers/cooksillustrated.py +++ b/cookbook/helper/scrapers/cooksillustrated.py @@ -46,8 +46,12 @@ class CooksIllustrated(AbstractScraper): def instructions(self): if not self.recipe: self.get_recipe() + if 'headnote' in self.recipe: + i = ['Note: ' + self.recipe.get('headnote', '')] + else: + i = [] return "\n".join( - ['Note: ' + self.recipe.get('headnote', '')] + i + [self.recipe['whyThisWorks']] + [ instruction['fields']['content']