diff --git a/modules/fortuneo/browser.py b/modules/fortuneo/browser.py index 525ab2a82feebc978e0d5c331f183f5401ce5403..217df70130ab31ef3011614bf9fe16a8d37255ac 100644 --- a/modules/fortuneo/browser.py +++ b/modules/fortuneo/browser.py @@ -268,6 +268,11 @@ def iter_accounts(self): self.page.fill_account(obj=account) else: self.location(account._history_link) + + # Sometimes the website displays a message about preventing scams. + if self.page.send_info_form(): + self.location(account._history_link) + if self.process_skippable_message(): self.location(account._history_link) diff --git a/modules/fortuneo/pages/accounts_list.py b/modules/fortuneo/pages/accounts_list.py index 3afd808933d60f2d1d8a094a11a6e9370454bd65..a055afb5182e1bf49b7cc2e5b4f43debfc64275c 100644 --- a/modules/fortuneo/pages/accounts_list.py +++ b/modules/fortuneo/pages/accounts_list.py @@ -115,6 +115,15 @@ def get_global_error_message(self): def get_local_error_message(self): return CleanText('//div[@id="error"]/p[@class="erreur_texte1"]')(self.doc) + def send_info_form(self): + try: + form = self.get_form(name='validation_messages_bloquants') + except FormNotFound: + return False + else: + form.submit() + return True + MARKET_ORDER_DIRECTIONS = { 'Achat': MarketOrderDirection.BUY, diff --git a/modules/fortuneo/pages/transfer.py b/modules/fortuneo/pages/transfer.py index 90f591639d44a0bf8ac31c7d162edd0698e97a17..f46aa42eb646024441bdee17560ac4e645a0b37a 100644 --- a/modules/fortuneo/pages/transfer.py +++ b/modules/fortuneo/pages/transfer.py @@ -25,7 +25,7 @@ from datetime import date, timedelta from itertools import chain -from woob.browser.pages import HTMLPage, PartialHTMLPage, LoggedPage, FormNotFound +from woob.browser.pages import HTMLPage, PartialHTMLPage, LoggedPage from woob.browser.elements import method, ListElement, ItemElement, SkipItem, TableElement from woob.browser.filters.html import Attr, Link, TableCell from woob.browser.filters.standard import ( @@ -141,15 +141,6 @@ def get_send_code_form(self): form.url = urls[0] return form - def send_info_form(self): - try: - form = self.get_form(name='validation_messages_bloquants') - except FormNotFound: - return False - else: - form.submit() - return True - class RecipientSMSPage(LoggedPage, PartialHTMLPage): def on_load(self):