From dcb18799b0f92b39ed1f8718f5d407075dbd7855 Mon Sep 17 00:00:00 2001 From: James Addison Date: Wed, 12 Oct 2022 16:52:10 +0100 Subject: [PATCH] Refactor: remove use of 'while' loop --- recipe_scrapers/nutritionbynathalie.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipe_scrapers/nutritionbynathalie.py b/recipe_scrapers/nutritionbynathalie.py index 6b1163cf7..b2913ae68 100644 --- a/recipe_scrapers/nutritionbynathalie.py +++ b/recipe_scrapers/nutritionbynathalie.py @@ -36,8 +36,7 @@ def ingredients(self): title = outerElement.find_parent("p") if not title: continue - element = title.nextSibling - while element: + for element in title.next_siblings: ingredient = element.get_text() if len(ingredient) == 0 or ord(ingredient[0]) != BULLET_CHARACTER_ORD: break