From 1312c7714cc99f92ad00e03313003725140d1650 Mon Sep 17 00:00:00 2001 From: feliciaan Date: Tue, 13 May 2014 12:26:45 +0200 Subject: [PATCH] fixed errors with empty h3 that float around --- scraper/resto.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scraper/resto.py b/scraper/resto.py index 893a04b8..27de2cd2 100755 --- a/scraper/resto.py +++ b/scraper/resto.py @@ -64,7 +64,8 @@ def __init__(self, date): self.vegetables = [] def parse(self, menu_div, lang): - titles = [x.content.lower() for x in menu_div.xpathEval('./h3')] + titles = [x.content.lower() for x in menu_div.xpathEval('./h3') if len(x.content) > 0] + print(titles) lists = menu_div.xpathEval('./ul[*]') if len(titles) == 1 and titles[0] == DICTIONARY[lang]['closed']: