The new woob repository is here: https://gitlab.com/woob/woob. This gitlab will be removed soon.

Commit a360f003 authored by Christophe François's avatar Christophe François Committed by Vincent A

[aviva] Handle empty investment_detail page

Sometimes the investment detail page is empty, with no error displayed.
parent 65a3e217
......@@ -22,7 +22,7 @@
from weboob.browser import LoginBrowser, need_login
from weboob.browser.url import BrowserParamURL
from weboob.capabilities.base import empty, NotAvailable
from weboob.capabilities.base import empty
from weboob.capabilities.bank import Account
from weboob.exceptions import (
BrowserIncorrectPassword, BrowserPasswordExpired,
......@@ -116,11 +116,11 @@ def iter_investment(self, account):
if not empty(inv.code):
# Need to go first on InvestDetailPage...
self.invest_detail.go(isin=inv.code)
# ...to then request the InvestPerformancePage tab
self.invest_performance.go()
self.page.fill_investment(obj=inv)
else:
inv.unitprice = inv.diff_ratio = inv.description = NotAvailable
# Sometimes the page loads but there is no info
if not self.page.is_empty():
# ...to then request the InvestPerformancePage tab
self.invest_performance.go()
self.page.fill_investment(obj=inv)
yield inv
@need_login
......
......@@ -271,7 +271,8 @@ def on_load(self):
class InvestDetailPage(LoggedPage, HTMLPage):
pass
def is_empty(self):
return not self.doc.xpath('//table')
class InvestPerformancePage(LoggedPage, HTMLPage):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment