Fix content of daily titles

Site changed
This commit is contained in:
Florent 2012-11-19 15:14:34 +01:00
commit 22d43408f1
2 changed files with 15 additions and 5 deletions

View file

@ -18,16 +18,18 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see <http://www.gnu.org/licenses/>. # along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .pages.article import PresseuropPage, CartoonPage from .pages.article import PresseuropPage, CartoonPage, DailyTitlesPage
from weboob.tools.browser import BaseBrowser from weboob.tools.browser import BaseBrowser
from weboob.tools.ordereddict import OrderedDict
class NewspaperPresseuropBrowser(BaseBrowser): class NewspaperPresseuropBrowser(BaseBrowser):
"NewspaperPresseuropBrowser class" "NewspaperPresseuropBrowser class"
PAGES = { PAGES = OrderedDict((
"http://www.presseurop.eu/.*/cartoon/.*": CartoonPage, ("http://www.presseurop.eu/.*/todays-front-pages/.*", DailyTitlesPage),
"http://www.presseurop.eu/.*": PresseuropPage, ("http://www.presseurop.eu/.*/cartoon/.*", CartoonPage),
} ("http://www.presseurop.eu/.*", PresseuropPage),
))
def is_logged(self): def is_logged(self):
return False return False

View file

@ -45,6 +45,14 @@ class PresseuropPage(GenericNewsPage):
return title return title
class DailyTitlesPage(PresseuropPage):
def on_loaded(self):
self.main_div = self.document.getroot()
self.element_title_selector = "title"
self.element_author_selector = "div[id=content-author]>a"
self.element_body_selector = "ul.articlebody"
class CartoonPage(PresseuropPage): class CartoonPage(PresseuropPage):
"CartoonPage object for presseurop" "CartoonPage object for presseurop"