Commit a2db8697 authored by Maxime Gasselin's avatar Maxime Gasselin Committed by Romain Bignon

[bp] remove triplicate transaction in bp pro

The next_page navigation is totally illogical. In the next page button
you can return to the first transactions. Morever no logical pattern in
history url navigation can be exploited. Nevertheless, we can skip
these pages with the comparaison of the first transaction of the page.

Closes: 8257@zendesk 8318@zendesk 8292@zendesk 9235@zendesk 9589@zendesk
parent 02bb0b93
......@@ -592,6 +592,7 @@ class BProBrowser(BPBrowser):
self.location(v.path, params=args)
self.first_transactions = []
for tr in
transactions.sort(key=lambda tr: tr.rdate, reverse=True)
......@@ -84,7 +84,27 @@ class ProAccountHistory(LoggedPage, MyHTMLPage):
class iter_history(ListElement):
item_xpath = u'//div[@id="tabReleve"]//tbody/tr'
next_page = Link('//div[@class="pagination"]//li[@class="pagin-on-right"]/a')
def next_page(self):
# The next page on the website can return pages already visited without logical mechanism
# Nevertheless we can skip these pages with the comparaison of the first transaction of the page
next_page_xpath = '//div[@class="pagination"]//li[@class="pagin-on-right"]/a'
tr_xpath = '//tbody/tr[1]'
next_page_link = Link(next_page_xpath)(self.el)
next_page =
first_transaction = CleanText(tr_xpath)(
count = 0 # avoid an infinite loop
while first_transaction in and count < 30:
next_page =
next_page_link = Link(next_page_xpath)(
first_transaction = CleanText(tr_xpath)(
count += 1
if count < 30:
class item(ItemElement):
klass = Transaction
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