From 025fc6bfc4bef9c143b9c8b91f51ede0493000de Mon Sep 17 00:00:00 2001 From: Xavier G Date: Thu, 3 May 2012 14:39:39 +0200 Subject: [PATCH] CrAgr: CA Sud Rhone Alpes now takes the adequate account label if possible. (closes #857) --- modules/cragr/pages/accounts_list.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/cragr/pages/accounts_list.py b/modules/cragr/pages/accounts_list.py index 551ea729..53238d7f 100644 --- a/modules/cragr/pages/accounts_list.py +++ b/modules/cragr/pages/accounts_list.py @@ -79,7 +79,11 @@ class AccountsList(CragrBasePage): account.label = div.findall('br')[0].tail.strip() s = div.xpath('following-sibling::div//b')[0].text else: - account.label = div.findall('br')[1].tail.strip() + label_container = div.xpath('./b/span') + if label_container and label_container[0].text is not None: + account.label = label_container[0].text.strip() + else: + account.label = div.findall('br')[1].tail.strip() account.id = div.find('span').text.strip() s = div.xpath('.//big')[0].text account.balance = clean_amount(s)