From dd33dbc418c372fb46761ff235c2e6c040651091 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Wed, 4 Sep 2013 17:09:44 +0200 Subject: [PATCH] fix parsing of cards with undefined payment date --- modules/societegenerale/sgpe/pages.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/societegenerale/sgpe/pages.py b/modules/societegenerale/sgpe/pages.py index a5627c5a..931e2606 100644 --- a/modules/societegenerale/sgpe/pages.py +++ b/modules/societegenerale/sgpe/pages.py @@ -17,6 +17,7 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . +import urllib from logging import error import re from decimal import Decimal @@ -150,13 +151,13 @@ class CardsPage(SGPEPage): continue link = tds[self.COL_ID].xpath('.//a')[0] - m = re.match(r"changeCarte\('(\d+)','(\d+)','([\d/]+)'\);.*", link.attrib['onclick']) + m = re.match(r"changeCarte\('(\d+)','(\d+)','([^']+)'\);.*", link.attrib['onclick']) if not m: self.logger.error('Unable to parse link %r' % link.attrib['onclick']) continue account.id = m.group(2) account._link_num = m.group(1) #useless - account._link_date = m.group(3) + account._link_date = urllib.quote(m.group(3)) account._link_rib = rib account._link_currency = currency account._is_card = True