From 8631de03e8f78ba9d679fc44d026124e598d3fef Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Mon, 2 Feb 2015 20:27:09 +0100 Subject: [PATCH] valuation information can be in several locations... --- modules/ing/pages/accounts_list.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/ing/pages/accounts_list.py b/modules/ing/pages/accounts_list.py index 353748a4..7300e01f 100644 --- a/modules/ing/pages/accounts_list.py +++ b/modules/ing/pages/accounts_list.py @@ -209,7 +209,11 @@ class AccountsList(LoggedPage, HTMLPage): obj_description = Async('details') & CleanText('//h5') obj_quantity = CleanDecimal('.//dl[contains(dt/text(), "Nombre de parts")]/dd', replace_dots=True) obj_unitvalue = CleanDecimal('.//dl[contains(dt/text(), "Valeur de part")]/dd', replace_dots=True) - obj_valuation = CleanDecimal('.//dl[has-class("ligne-montant")]/dd', replace_dots=True) + + # There are two kind of lists: + # - Header contains percent and valuation is in a specific row ("ligne-montant") + # - Header contains valuation, there is no "ligne-montant" row, and percent is in a specific row + obj_valuation = CleanDecimal('.//dl[has-class("ligne-montant")]/dd | .//dd[@data-show="header" and not(contains(text(), "%"))]', replace_dots=True) def obj_unitprice(self): if 'eurossima' in self.el.get('class'):