From aa9911e40338083fee734580ef71f8b702d31f30 Mon Sep 17 00:00:00 2001 From: Quentin Defenouillere Date: Wed, 6 Mar 2019 17:41:49 +0100 Subject: [PATCH] [boursorama] Correct cards disappearance again The card page changed again and the numbers were in different xpaths so the cards were not retrieved. Closes: 9918@zendesk, 9987@zendesk --- modules/boursorama/pages.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/boursorama/pages.py b/modules/boursorama/pages.py index bf395fe6a1..00e8850ba8 100644 --- a/modules/boursorama/pages.py +++ b/modules/boursorama/pages.py @@ -793,7 +793,11 @@ def populate_cards_number(self, cards): # With the card hash we can get the card number. # Non activated cards have no card_hash and therefore no # card number so we can easily eliminate them afterwards. - card.number = CleanText('//div[@data-card-key="%s"]/div/span' % card_hash)(self.doc) + card_details = CleanText('//div[@data-card-key="%s"]' % card_hash)(self.doc).replace(' ', '') + # We are looking for "4978********1234" in card_details: + number_search = re.search(r'\d{4}\*{8}\d{4}', card_details) + if number_search: + card.number = number_search.group(0) class HomePage(LoggedPage, HTMLPage): -- GitLab