mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update Le Monde Edition Abonnes Papier
This commit is contained in:
parent
811a1d3d1e
commit
63c1aa15e4
@ -130,10 +130,7 @@ 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)
|
||||||
try:
|
title = soup.find('span').contents[0]
|
||||||
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":
|
||||||
@ -147,13 +144,15 @@ class LeMondeAbonne(BasicNewsRecipe):
|
|||||||
if title == "Enquete":
|
if title == "Enquete":
|
||||||
title = "Enquête"
|
title = "Enquête"
|
||||||
if title == "Editorial - Analyses":
|
if title == "Editorial - Analyses":
|
||||||
title = "Analyses"
|
title = "Horizons"
|
||||||
if title == "Le Monde Economie":
|
if title == "Le Monde Economie":
|
||||||
title = "Économie"
|
title = "Économie"
|
||||||
if title == "Le Monde Culture et idées":
|
if title == "Lettre et chronique":
|
||||||
title = "Idées"
|
title = "Idées"
|
||||||
if title == "Le Monde Géo et politique":
|
if title == "Le Monde Géo et politique":
|
||||||
title = "Géopolitique"
|
title = "Géopolitique"
|
||||||
|
if title == "Météo - Jeux - Ecrans":
|
||||||
|
title = "Économie & Entreprise"
|
||||||
tmp.close()
|
tmp.close()
|
||||||
|
|
||||||
filename = os.path.join(path, "frame_gauche_%d.html" % (i + 1))
|
filename = os.path.join(path, "frame_gauche_%d.html" % (i + 1))
|
||||||
@ -175,3 +174,8 @@ class LeMondeAbonne(BasicNewsRecipe):
|
|||||||
flux.append((title, articles))
|
flux.append((title, articles))
|
||||||
|
|
||||||
return flux
|
return flux
|
||||||
|
|
||||||
|
|
||||||
|
# Local Variables:
|
||||||
|
# mode: python
|
||||||
|
# End:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user