diff --git a/modules/creditdunord/browser.py b/modules/creditdunord/browser.py index d4eb278f5c34a12bbf0658d29fd77564c14bb13d..fdb236e744975fef2d27db62d234347f81f7d4c0 100644 --- a/modules/creditdunord/browser.py +++ b/modules/creditdunord/browser.py @@ -56,13 +56,14 @@ def is_logged(self): def home(self): if self.is_logged(): - self.location('/vos-comptes/%s' % self.account_type) + self.location('/vos-comptes/%s' % self.account_type, params=self.strid) self.location(self.page.doc.xpath(u'//a[contains(text(), "Synthèse")]')[0].attrib['href']) else: self.do_login() def do_login(self): self.login.go().login(self.username, self.password) + self.strid = {"strid": self.page.get_strid()} if self.accounts.is_here(): expired_error = self.page.get_password_expired() @@ -134,7 +135,7 @@ def get_history(self, account, coming=False): if coming and account.type is not Account.TYPE_CARD or account.type is Account.TYPE_LOAN: return [] - self.location('/vos-comptes/%s' % self.account_type) + self.location('/vos-comptes/%s' % self.account_type, params=self.strid) transactions = [] for tr in self.iter_transactions(account._link, account._args, account.type): transactions.append(tr) diff --git a/modules/creditdunord/pages.py b/modules/creditdunord/pages.py index 6def3ca9e13c0695200d4fc970e26ae38410b7bf..0f487997c3005fe382577da20e8a5ef840c8dbed 100755 --- a/modules/creditdunord/pages.py +++ b/modules/creditdunord/pages.py @@ -30,6 +30,7 @@ from weboob.browser.pages import HTMLPage, LoggedPage from weboob.browser.elements import method, ItemElement from weboob.browser.filters.standard import CleanText, Date, CleanDecimal, Regexp +from weboob.browser.filters.html import Attr from weboob.exceptions import ActionNeeded, BrowserIncorrectPassword, BrowserUnavailable from weboob.capabilities.bank import Account, Investment from weboob.capabilities.profile import Profile @@ -306,6 +307,9 @@ class get_profile(ItemElement): obj_name = CleanText('//p[@class="nom"]') + def get_strid(self): + return re.search(r'(\d{4,})', Attr('//form[@name="changePageForm"]', 'action')(self.doc)).group(0) + class AVPage(LoggedPage, CDNBasePage): COL_LABEL = 0