This commit is contained in:
juke 2011-02-07 13:41:26 +01:00
commit 40279a744f
3 changed files with 5 additions and 25 deletions

View file

@ -17,6 +17,8 @@
from .pages.article import ArticlePage from .pages.article import ArticlePage
from .pages.ledirect import LeDirectPage from .pages.ledirect import LeDirectPage
from .pages.preums import PreumsPage
from .pages.minutes20 import Minutes20Page
from weboob.tools.browser import BaseBrowser from weboob.tools.browser import BaseBrowser
__all__ = ['Newspaper20minutesBrowser'] __all__ = ['Newspaper20minutesBrowser']
@ -25,7 +27,8 @@ __all__ = ['Newspaper20minutesBrowser']
class Newspaper20minutesBrowser(BaseBrowser): class Newspaper20minutesBrowser(BaseBrowser):
PAGES = { PAGES = {
'http://www.20minutes.fr/article/?.*': ArticlePage, 'http://www.20minutes.fr/article/?.*': ArticlePage,
'http://www.20minutes.fr/ledirect/?.*': LeDirectPage 'http://www.20minutes.fr/ledirect/?.*': Minutes20Page,
'http://www.20minutes.fr/preums/?.*': Minutes20Page
} }

View file

@ -1,23 +0,0 @@
# -*- coding: utf-8 -*-
# Copyright(C) 2011 Julien Hebert
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
from weboob.tools.parsers.lxmlparser import select
from .minutes20 import Minutes20Page
class LeDirectPage(Minutes20Page):
def set_body(self):
self.article.body = self.browser.parser.tostring(select(self.main_div, "div.mna-body", 1))

View file

@ -39,7 +39,7 @@ class Minutes20Page(BasePage):
return select(self.main_div, "div.mna-signature", 1) return select(self.main_div, "div.mna-signature", 1)
def set_body(self): def set_body(self):
raise NotImplementedError self.article.body = self.browser.parser.tostring(select(self.main_div, "div.mna-body", 1))
def on_loaded(self): def on_loaded(self):