do not crash if there is no operations
This commit is contained in:
parent
039d022fe6
commit
5c5cb5da8e
2 changed files with 8 additions and 0 deletions
|
|
@ -110,7 +110,12 @@ class BanquePopulaire(BaseBrowser):
|
|||
def get_history(self, account):
|
||||
if not self.is_on_page(AccountsPage):
|
||||
account = self.get_account(account.id)
|
||||
|
||||
self.location('/cyber/internet/ContinueTask.do', urllib.urlencode(account._params))
|
||||
self.token = self.page.get_token()
|
||||
|
||||
if self.page.no_operations():
|
||||
return
|
||||
|
||||
# Sort by values dates (see comment in TransactionsPage.get_history)
|
||||
self.select_form(predicate=lambda form: form.attrs.get('id', '') == 'myForm')
|
||||
|
|
|
|||
|
|
@ -320,3 +320,6 @@ class TransactionsPage(BasePage):
|
|||
t.parse(date, re.sub(r'[ ]+', ' ', raw), vdate)
|
||||
t.set_amount(credit, debit)
|
||||
yield t
|
||||
|
||||
def no_operations(self):
|
||||
return len(self.document.xpath('//table[@id="tbl1"]//td[@colspan]')) > 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue