get more history on cards

This commit is contained in:
Romain Bignon 2014-04-26 23:08:44 +02:00
commit 188220e0c1

View file

@ -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