fix when there are no transactions for the account
This commit is contained in:
parent
68add41f7f
commit
39657d53c8
1 changed files with 7 additions and 2 deletions
|
|
@ -26,7 +26,7 @@ import re
|
||||||
|
|
||||||
from weboob.capabilities.bank import Account
|
from weboob.capabilities.bank import Account
|
||||||
from weboob.tools.capabilities.bank.transactions import FrenchTransaction
|
from weboob.tools.capabilities.bank.transactions import FrenchTransaction
|
||||||
from weboob.tools.browser import BasePage
|
from weboob.tools.browser import BasePage, BrokenPageError
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['AccountsList', 'AccountHistory']
|
__all__ = ['AccountsList', 'AccountHistory']
|
||||||
|
|
@ -106,7 +106,12 @@ class AccountHistory(BasePage):
|
||||||
|
|
||||||
while 1:
|
while 1:
|
||||||
d = XML(self.browser.readurl(url))
|
d = XML(self.browser.readurl(url))
|
||||||
el = d.xpath('//dataBody')[0]
|
try:
|
||||||
|
el = self.parser.select(d, '//dataBody', 1, 'xpath')
|
||||||
|
except BrokenPageError:
|
||||||
|
# No transactions.
|
||||||
|
return
|
||||||
|
|
||||||
s = StringIO(unicode(el.text).encode('iso-8859-1'))
|
s = StringIO(unicode(el.text).encode('iso-8859-1'))
|
||||||
doc = self.browser.get_document(s)
|
doc = self.browser.get_document(s)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue