From 188220e0c10253e00071deb9401e7851f8868bb2 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Sat, 26 Apr 2014 23:08:44 +0200 Subject: [PATCH] get more history on cards --- modules/boursorama/pages/card_history.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/boursorama/pages/card_history.py b/modules/boursorama/pages/card_history.py index 0a819a4e..a4d99656 100644 --- a/modules/boursorama/pages/card_history.py +++ b/modules/boursorama/pages/card_history.py @@ -61,4 +61,15 @@ class CardHistory(BasePage): yield operation def get_next_url(self): - return None + items = self.document.getroot().cssselect('ul.menu-lvl-1 li') + + current = False + for li in reversed(items): + if li.attrib.get('class', '') == 'active': + current = True + elif current: + a = li.find('a') + if 'year' in a.attrib.get('href', ''): + return a.attrib['href'] + else: + return None