From 2c63f6d52e6279c5755c016fe452b67637c07fb6 Mon Sep 17 00:00:00 2001 From: Florent Date: Tue, 25 Mar 2014 13:25:25 +0100 Subject: [PATCH] Better next_page field --- modules/poivy/pages.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/modules/poivy/pages.py b/modules/poivy/pages.py index c1aa9edb..8e26b95a 100644 --- a/modules/poivy/pages.py +++ b/modules/poivy/pages.py @@ -69,13 +69,8 @@ class HistoryPage(LoggedPage, HTMLPage): class get_calls(ListElement): item_xpath = '//table/tbody/tr' - def next_page(self): - link_path = "//div[@class='date-navigator center']/span/a" - text = CleanText(link_path)(self.page.doc) - if "Previous" in text: - link = Link(link_path)(self.page.doc) - return link - return + next_page = Link("//div[@class='date-navigator center']/span/a[contains(text(), 'Previous')]", + default=None) class item(ItemElement): klass = Detail