This commit is contained in:
Kovid Goyal 2018-08-01 03:10:16 +05:30
parent 9205f188b9
commit ded06e6b00
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -131,7 +131,10 @@ class LeMondeAbonne(BasicNewsRecipe):
filename = os.path.join(path, "selection_%d.html" % (i + 1)) filename = os.path.join(path, "selection_%d.html" % (i + 1))
tmp = open(filename, 'r') tmp = open(filename, 'r')
soup = BeautifulSoup(tmp, convertEntities=BeautifulSoup.HTML_ENTITIES) soup = BeautifulSoup(tmp, convertEntities=BeautifulSoup.HTML_ENTITIES)
title = soup.find('span').contents[0] or 'Unknown' try:
title = soup.find('span').contents[0] or 'Unknown'
except IndexError:
title = 'Unknown'
if title == "Une": if title == "Une":
title = "À la une" title = "À la une"
if title == "Evenement": if title == "Evenement":