From 5cf599660bc0be97ab1fa8399042158ae8d2d220 Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Sat, 30 Mar 2013 16:11:57 +0100 Subject: [PATCH] [allrecipes] ignore strange quantity description, small fix --- modules/allrecipes/pages.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/allrecipes/pages.py b/modules/allrecipes/pages.py index f127de56..005f783a 100644 --- a/modules/allrecipes/pages.py +++ b/modules/allrecipes/pages.py @@ -71,7 +71,7 @@ class RecipePage(BasePage): ingredients = NotAvailable picture_url = NotAvailable instructions = NotAvailable - comments = [] + comments = NotAvailable title = unicode(self.parser.select(self.document.getroot(), 'h1#itemTitle', 1).text) imgillu = self.parser.select(self.document.getroot(), 'img#imgPhoto') @@ -111,7 +111,7 @@ class RecipePage(BasePage): if cookmin != 0: cooking_time = cookmin l_nbpers = self.parser.select(self.document.getroot(), 'span#lblYield[itemprop=recipeYield]') - if len(l_nbpers) > 0: + if len(l_nbpers) > 0 and 'servings' in l_nbpers[0].text: nb_person = [int(l_nbpers[0].text.split()[0])] recipe = Recipe(id, title)