From 5dc37e3f693cd136adfccc3e3f0e7ea218bd4641 Mon Sep 17 00:00:00 2001 From: Maxime Gasselin Date: Tue, 26 Feb 2019 17:38:11 +0100 Subject: [PATCH] [bp] Handle new history url case In some case the url is inside the span tag. Closes: 37311@sibi --- modules/bp/pages/accountlist.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/bp/pages/accountlist.py b/modules/bp/pages/accountlist.py index 2976861cd0..53241736df 100644 --- a/modules/bp/pages/accountlist.py +++ b/modules/bp/pages/accountlist.py @@ -29,7 +29,7 @@ from weboob.capabilities.profile import Person from weboob.browser.elements import ListElement, ItemElement, method, TableElement from weboob.browser.pages import LoggedPage, RawPage, PartialHTMLPage, HTMLPage -from weboob.browser.filters.html import Link, TableCell +from weboob.browser.filters.html import Link, TableCell, Attr from weboob.browser.filters.standard import CleanText, CleanDecimal, Regexp, Env, Field, Currency, Async, Date, Format from weboob.exceptions import BrowserUnavailable from weboob.tools.compat import urljoin, unicode @@ -57,6 +57,8 @@ def condition(self): def obj_url(self): url = Link(u'./a', default=NotAvailable)(self) + if not url: + url = Regexp(Attr(u'.//span', 'onclick', default=''), r'\'(https.*)\'', default=NotAvailable)(self) if url: if 'CreditRenouvelable' in url: url = Link(u'.//a[contains(text(), "espace de gestion crédit renouvelable")]')(self.el) -- GitLab