From 4bebb5de56d33e28748a637a224883a01837edb2 Mon Sep 17 00:00:00 2001 From: Vincent Paredes Date: Fri, 12 Jun 2015 14:11:31 +0200 Subject: [PATCH] handling account without history --- modules/bnporc/deprecated/browser.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/bnporc/deprecated/browser.py b/modules/bnporc/deprecated/browser.py index cd7289f6..025419dd 100644 --- a/modules/bnporc/deprecated/browser.py +++ b/modules/bnporc/deprecated/browser.py @@ -184,7 +184,10 @@ class BNPorc(Browser): self.location('https://www.secure.bnpparibas.net/banque/portail/particulier/FicheA', urllib.urlencode(data)) - execution = self.page.document.xpath('//form[@name="displayStatementForm"]/input[@name="_flowExecutionKey"]')[0].attrib['value'] + e = self.page.document.xpath('//form[@name="displayStatementForm"]/input[@name="_flowExecutionKey"]') + if len(e) != 1: + return + execution = e[0].attrib['value'] data = {'_eventId': 'changeOperationsPerPage', 'newCategoryId': '', 'categorisationInProgress': '',