From 681c97440d64953eb5e7bd65993c67b8fcd6e1e2 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Mon, 7 May 2012 10:11:50 +0200 Subject: [PATCH] fix duplicate IDs of accounts --- modules/hsbc/pages/accounts.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/hsbc/pages/accounts.py b/modules/hsbc/pages/accounts.py index 211b9a17..1ccac993 100644 --- a/modules/hsbc/pages/accounts.py +++ b/modules/hsbc/pages/accounts.py @@ -44,8 +44,11 @@ class AccountsListPage(BasePage): account.label = a.text.strip() account._link_id = a.attrib['href'] - if not 'CPT_IdPrestation' in account._link_id: + m = re.search('(\w+)_IdPrestation', account._link_id) + if not m or m.group(1) != 'CPT': account._link_id = None + if m: + account.id += '.%s' % m.group(1) tag = tds[2].find('font') if tag is None: