fix getting 100 transactions instead of 30 (from history)

This commit is contained in:
Romain Bignon 2012-05-31 14:05:54 +02:00 committed by Romain Bignon
commit bbf3db6c01

View file

@ -156,8 +156,8 @@ class BNPorc(BaseBrowser):
'groupSelected':'-2', 'groupSelected':'-2',
'step': 'STAMENTS', 'step': 'STAMENTS',
'pageId': 'releveoperations', 'pageId': 'releveoperations',
'operationsPerPage': 100, #'operationsPerPage': 100,
'_eventId': 'changeOperationsPerPage', #'_eventId': 'changeOperationsPerPage',
'sendEUD': 'true', 'sendEUD': 'true',
'execution': execution, 'execution': execution,
} }
@ -165,17 +165,21 @@ class BNPorc(BaseBrowser):
self.location('https://www.secure.bnpparibas.net/banque/portail/particulier/FicheA', urllib.urlencode(data)) 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'] execution = self.page.document.xpath('//form[@name="displayStatementForm"]/input[@name="_flowExecutionKey"]')[0].attrib['value']
data = {'_eventId': 'changeOperationsPerPage', data = {'_eventId': 'changeOperationsPerPage',
'categoryId': '', 'newCategoryId': '',
'contractId': '', 'categorisationInProgress': '',
'_flowExecutionKey': execution, 'contractId': id,
'groupId': '', '_flowExecutionKey': execution,
'listCheckedOp': '', 'groupId': '-2',
'myPage': 1, 'operations.objectsPerPage': 100,
'operationId': '', 'operations.pageNumber': 1,
'operationsPerPage': 100, 'pageId': 'releveoperations',
'pageId': 'releveoperations',
} }
# it's not a joke, BNP guys are really crappy.
for i in xrange(30):
data['_operations.list[%d].checkedOff' % i] = 'on'
data['_operations.list[%d].selectedForCategorization' % i] = 'on'
self.location('https://www.secure.bnpparibas.net/banque/portail/particulier/FicheA', urllib.urlencode(data)) self.location('https://www.secure.bnpparibas.net/banque/portail/particulier/FicheA', urllib.urlencode(data))
return self.page.iter_operations() return self.page.iter_operations()