Commit 39d0a931 authored by Guillaume Risbourg's avatar Guillaume Risbourg Committed by Vincent A

[lcl] Changed transactions details link

The link we retrieve from the HTML is really unstable and has a lot of
HTTP Error 500. The new link (used by the website for elements that do
not have `href` attributes) works fine.
parent 7c55932f
......@@ -71,7 +71,7 @@ class LCLBrowser(LoginBrowser, StatesMixin):
accounts = URL(r'/outil/UWSP/Synthese', AccountsPage)
client = URL(r'/outil/uwho', ClientPage)
history = URL(
r'/outil/UWLM/ListeMouvements.*/accesListeMouvements.*',
r'/outil/UWLM/ListeMouvements.*/acces(ListeMouvements|DetailsMouvement).*',
r'/outil/UWLM/DetailMouvement.*/accesDetailMouvement.*',
r'/outil/UWLM/Rebond',
AccountHistoryPage)
......
......@@ -464,11 +464,12 @@ class AccountHistoryPage(LoggedPage, HTMLPage):
class item(Transaction.TransactionElement):
def load_details(self):
link = Attr('.', 'href', default=None)(self)
if not link:
self.logger.warning('Found operation without detail url.')
return None
return self.page.browser.async_open(link, method='POST')
row = Attr('.', 'id', default=None)(self)
assert row, 'HTML format of transactions details changed'
return self.page.browser.async_open(
'/outil/UWLM/ListeMouvementsParticulier/accesDetailsMouvement?element=%s' % row,
method='POST',
)
def obj_type(self):
type = Async('details', CleanText(u'//td[contains(text(), "Nature de l\'opération")]/following-sibling::*[1]'))(self)
......
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