[lefigaro] fix : site changed

This commit is contained in:
Bezleputh 2014-02-26 20:05:59 +01:00
commit 7492c0bdc4
3 changed files with 7 additions and 8 deletions

View file

@ -29,15 +29,15 @@ class IndexPage(BasePage):
class NewspaperFigaroBrowser(BaseBrowser):
"NewspaperFigaroBrowser class"
ENCODING = None
PAGES = {
"http://\w+.lefigaro.fr/flash-.*/(\d{4})/(\d{2})/(\d{2})/(.*$)": FlashActuPage,
ENCODING = "UTF-8"
PAGES = {"http://\w+.lefigaro.fr/flash-.*/(\d{4})/(\d{2})/(\d{2})/(.*$)": FlashActuPage,
"http://\w+.lefigaro.fr/bd/(\d{4})/(\d{2})/(\d{2})/(.*$)": FlashActuPage,
"http://\w+.lefigaro.fr/(?!flash-|bd|actualite).+/(\d{4})/(\d{2})/(\d{2})/(.*$)": ArticlePage,
"http://\w+.lefigaro.fr/actualite/(\d{4})/(\d{2})/(\d{2})/(.*$)": ActuPage,
"http://\w+.lefigaro.fr/actualite-.*/(\d{4})/(\d{2})/(\d{2})/(.*$)": ArticlePage,
"http://\w+.lefigaro.fr/": IndexPage,
}
"http://feeds.lefigaro.fr/c/32266/f/438190/s/\w+/sc/\d{2}/\d{1}/\w+/story01.htm": FlashActuPage,
}
def is_logged(self):
return False

View file

@ -18,7 +18,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.capabilities.messages.genericArticle import GenericNewsPage, remove_from_selector_list, drop_comments, try_drop_tree, try_remove_from_selector_list
from weboob.tools.capabilities.messages.genericArticle import GenericNewsPage, drop_comments, try_drop_tree, try_remove_from_selector_list
class ArticlePage(GenericNewsPage):
@ -27,11 +27,10 @@ class ArticlePage(GenericNewsPage):
self.main_div = self.document.getroot()
self.element_title_selector = "h1"
self.element_author_selector = "span.auteur>a, span.auteur_long>div"
self.element_body_selector = "#article, div.article"
self.element_body_selector = "article div.fig-article-body"
def get_body(self):
element_body = self.get_element_body()
remove_from_selector_list(self.parser, element_body, [self.element_title_selector])
drop_comments(element_body)
try_drop_tree(self.parser, element_body, "script")
try_drop_tree(self.parser, element_body, "liste")

View file

@ -27,7 +27,7 @@ class FlashActuPage(GenericNewsPage):
self.main_div = self.document.getroot()
self.element_title_selector = "h1"
self.element_author_selector = "div.name>span"
self.element_body_selector = "h2"
self.element_body_selector = "article, fig-article-body"
def get_body(self):
element_body = self.get_element_body()