Commit e140775d authored by Martin Lavoie's avatar Martin Lavoie Committed by Vincent A

[fortuneo] Skip page that inform the user about the scam season

When going to the history_link to get more info, we sometime
a page about fraud with tips to the user on how to stay safe.
A similar case was handled previously when creating new recipient.
parent 170e49b2
......@@ -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)
......
......@@ -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,
......
......@@ -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):
......
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