update ATK scrape to handle empty headnote

This commit is contained in:
smilerz 2021-04-17 17:12:43 -05:00
parent 2f27413c0a
commit 7930c2417c

View File

@ -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']