sgpe: At least have unique ids in a call

This commit is contained in:
Laurent Bachelier 2013-07-24 17:00:06 +02:00
commit ab7c812056
2 changed files with 5 additions and 3 deletions

View file

@ -89,10 +89,12 @@ class SGPEBrowser(BaseBrowser):
def iter_history(self, account):
page = 1
basecount = 0
while page:
self.history(account.id, page)
assert self.is_on_page(HistoryPage)
for transaction in self.page.iter_transactions(account):
for transaction in self.page.iter_transactions(account, basecount):
basecount = transaction.id + 1
yield transaction
if self.page.has_next():
page += 1

View file

@ -113,9 +113,9 @@ class AccountsPage(SGPEPage):
class HistoryPage(SGPEPage):
def iter_transactions(self, account):
def iter_transactions(self, account, basecount):
table = self.parser.select(self.document.getroot(), '#tab-corps', 1)
for i, tr in enumerate(self.parser.select(table, 'tr', 'many')):
for i, tr in enumerate(self.parser.select(table, 'tr', 'many'), basecount):
# td colspan=5
if len(self.parser.select(tr, 'td')) == 1:
continue