[weboob] [PATCH 1/2] SG: update account page list to changes on webpage

Jocelyn Jaubert jocelyn.jaubert at gmail.com
Thu Jan 26 21:42:04 CET 2012


Signed-off-by: Jocelyn Jaubert <jocelyn.jaubert at gmail.com>
---
 modules/societegenerale/pages/accounts_list.py |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/societegenerale/pages/accounts_list.py b/modules/societegenerale/pages/accounts_list.py
index a18f918..652f69d 100644
--- a/modules/societegenerale/pages/accounts_list.py
+++ b/modules/societegenerale/pages/accounts_list.py
@@ -32,12 +32,12 @@ class AccountsList(BasePage):
     def get_list(self):
         l = []
         for tr in self.document.getiterator('tr'):
-            if tr.attrib.get('class', '') == 'LGNTableRow':
+            if 'LGNTableRow' in tr.attrib.get('class', '').split():
                 account = Account()
                 for td in tr.getiterator('td'):
                     if td.attrib.get('headers', '') == 'TypeCompte':
                         a = td.find('a')
-                        account.label = a.text
+                        account.label = a.find("span").text
                         account.link_id = a.get('href', '')
 
                     elif td.attrib.get('headers', '') == 'NumeroCompte':
@@ -49,9 +49,9 @@ class AccountsList(BasePage):
                         pass
 
                     elif td.attrib.get('headers', '') == 'Solde':
-                        balance = td.text
-                        balance = balance.replace(u'\xa0','').replace(',','.')
-                        if balance != "":
+                        balance = td.find('div').text
+                        if balance != None:
+                            balance = balance.replace(u'\xa0','').replace(',','.')
                             account.balance = float(balance)
                         else:
                             account.balance = 0.0
-- 
1.7.8.3




More information about the weboob mailing list