From 63c1aa15e4d5df952e33faac4397f400b5fee5f0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 9 Apr 2019 10:27:35 +0530 Subject: [PATCH] Update Le Monde Edition Abonnes Papier --- recipes/le_monde_sub_paper.recipe | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/recipes/le_monde_sub_paper.recipe b/recipes/le_monde_sub_paper.recipe index c1fe795989..9e649e790a 100644 --- a/recipes/le_monde_sub_paper.recipe +++ b/recipes/le_monde_sub_paper.recipe @@ -130,10 +130,7 @@ class LeMondeAbonne(BasicNewsRecipe): filename = os.path.join(path, "selection_%d.html" % (i + 1)) tmp = open(filename, 'r') soup = BeautifulSoup(tmp, convertEntities=BeautifulSoup.HTML_ENTITIES) - try: - title = soup.find('span').contents[0] or 'Unknown' - except IndexError: - title = 'Unknown' + title = soup.find('span').contents[0] if title == "Une": title = "À la une" if title == "Evenement": @@ -147,13 +144,15 @@ class LeMondeAbonne(BasicNewsRecipe): if title == "Enquete": title = "Enquête" if title == "Editorial - Analyses": - title = "Analyses" + title = "Horizons" if title == "Le Monde Economie": title = "Économie" - if title == "Le Monde Culture et idées": + if title == "Lettre et chronique": title = "Idées" if title == "Le Monde Géo et politique": title = "Géopolitique" + if title == "Météo - Jeux - Ecrans": + title = "Économie & Entreprise" tmp.close() filename = os.path.join(path, "frame_gauche_%d.html" % (i + 1)) @@ -175,3 +174,8 @@ class LeMondeAbonne(BasicNewsRecipe): flux.append((title, articles)) return flux + + +# Local Variables: +# mode: python +# End: