Commit 87778a7c authored by Quentin Defenouillere's avatar Quentin Defenouillere Committed by Romain Bignon

[boursorama] Skip checking coming transactions because 'date' disappeared

Before, the 'mes prélèvements à venir' tab contained a date in the
'.//time' xpath but it does not exist anymore, so we do not retrieve
these transactions any longer.

Closes: 44064@sibi
parent f49b508f
......@@ -333,20 +333,18 @@ class BoursoramaBrowser(RetryLoginBrowser, StatesMixin):
return self.get_regular_transactions(account, coming)
def get_regular_transactions(self, account, coming):
# We look for 3 years of history.
params = {}
params['movementSearch[toDate]'] = (date.today() + relativedelta(days=40)).strftime('%d/%m/%Y')
params['movementSearch[fromDate]'] = (date.today() - relativedelta(years=3)).strftime('%d/%m/%Y')
params['movementSearch[selectedAccounts][]'] = account._webid
if not coming:
# We look for 3 years of history.
params = {}
params['movementSearch[toDate]'] = (date.today() + relativedelta(days=40)).strftime('%d/%m/%Y')
params['movementSearch[fromDate]'] = (date.today() - relativedelta(years=3)).strftime('%d/%m/%Y')
params['movementSearch[selectedAccounts][]'] = account._webid
self.location('%s/mouvements' % account.url.rstrip('/'), params=params)
for transaction in self.page.iter_history():
yield transaction
elif account.type == Account.TYPE_CHECKING:
self.location('%s/mouvements-a-venir' % account.url.rstrip('/'), params=params)
for transaction in self.page.iter_history(coming=True):
yield transaction
# Note: Checking accounts have a 'Mes prélèvements à venir' tab,
# but these transactions have no date anymore so we ignore them.
def get_card_transactions(self, account, coming):
# All card transactions can be found in the CSV (history and coming),
......
......@@ -460,7 +460,6 @@ class HistoryPage(LoggedPage, HTMLPage):
class item(ItemElement):
klass = Transaction
obj_date = Date(Attr('.//time', 'datetime'))
obj_amount = CleanDecimal('.//div[has-class("list__movement__line--amount")]', replace_dots=True)
obj_category = CleanText('.//span[has-class("category")]')
obj__account_name = CleanText('.//span[contains(@class, "account__name-xs")]', default=None)
......
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