Commit 42c6ce2d authored by Edouard Lambert's avatar Edouard Lambert Committed by Romain Bignon

fixing spirica module : no pagination

fixing spirica module when not enough transactions is available
parent 6d54ec1a
......@@ -61,8 +61,10 @@ class SpiricaBrowser(LoginBrowser):
form = self.location(account._link).page.get_historytab_form()
# Get form to show all transactions
form = self.location(form.url, data=dict(form)).page.get_historyallpages_form()
if form:
self.location(form.url, data=dict(form))
# Get forms to expand details of all transactions
for form in self.location(form.url, data=dict(form)).page.get_historyexpandall_form():
for form in self.page.get_historyexpandall_form():
self.location(form.url, data=dict(form))
# Get all transactions
self.skipped = []
......
......@@ -125,10 +125,13 @@ class DetailsPage(LoggedPage, HTMLPage):
return form
def get_historyallpages_form(self):
form = self.get_form('//form[contains(@id, "j_idt")]')
idt = re.search('{[^\w]+([\w\d:]+)', self.doc.xpath('//a[contains(text(), "Tout")]/@onclick')[0]).group(1)
form[idt] = idt
return form
onclick = self.doc.xpath('//a[contains(text(), "Tout")]/@onclick')
if onclick:
idt = re.search('{[^\w]+([\w\d:]+)', onclick[0]).group(1)
form = self.get_form('//form[contains(@id, "j_idt")]')
form[idt] = idt
return form
return False
def get_historyexpandall_form(self):
form = self.get_form('//form[contains(@id, "j_idt")]')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment