parse multiple ingredientGroups
previous version assumed only a single item in a list - this loops through each item
This commit is contained in:
parent
5869a8ad1b
commit
2f27413c0a
@ -30,7 +30,9 @@ class CooksIllustrated(AbstractScraper):
|
|||||||
def ingredients(self):
|
def ingredients(self):
|
||||||
if not self.recipe:
|
if not self.recipe:
|
||||||
self.get_recipe()
|
self.get_recipe()
|
||||||
ingredients = self.recipe['ingredientGroups'][0]['fields']['recipeIngredientItems']
|
ingredients = []
|
||||||
|
for group in self.recipe['ingredientGroups']:
|
||||||
|
ingredients += group['fields']['recipeIngredientItems']
|
||||||
return [
|
return [
|
||||||
"{} {} {}{}".format(
|
"{} {} {}{}".format(
|
||||||
i['fields']['qty'] or '',
|
i['fields']['qty'] or '',
|
||||||
|
Loading…
Reference in New Issue
Block a user