Commit 99053629 authored by Florent Viard's avatar Florent Viard Committed by Vincent A

[bp] Fixes coming history that was returning incorrect labels

Here are exemples of labels that were returned for coming transactions:
data-titrepopinv2="Détail d'une opération" >PREL D
data-titrepopinv2="Détail d'une opération" >FR6720
data-titrepopinv2="Détail d'une opération" >200410

It should have been:
PREL DE MATMUT ROUEN
FR672045353464765875867865556435
200410414141414141414343

The previous code was not working well because there are two "<a>"
elements, one at the root and one inside a "<noscript>" element.
Sadly the one inside the noscript element is kind of broken:
<a class="popinV3"
href="../../comptesCommun/detailoperation/operation-detail_operation.ea?idxOperation=0&amp;typeOperation=OAV"
target="_blank"> data-titrepopinv2="D&#233;tail d\'une op&#233;ration"
&gt;PREL DE MATMUT ROUEN

The a element is incorrectly closed after "blank" and the real end
symbol is escaped.

To be noted: this way to extract the transaction is only related to
coming transactions. For normal history, the line content is extracted
by the previous part of the code, and is based on a span element and no
"noscript".
parent 2241eafc
......@@ -34,7 +34,7 @@
from weboob.browser.filters.html import Link, TableCell
from weboob.browser.filters.standard import (
CleanDecimal, CleanText, Eval, Async, AsyncLoad, Date, Env, Format,
Regexp,
Regexp, Base,
)
from weboob.tools.compat import urljoin
......@@ -217,7 +217,7 @@ def parse(self, el):
if (label and label.split()[0] != raw_label.split()[0]) or not label:
label = raw_label
self.env['raw_label'] = CleanText(TableCell('label')(self)[0].xpath('./noscript'))(self) or label
self.env['raw_label'] = Base(TableCell('label'), CleanText('a'))(self) or label
obj_raw = Transaction.Raw(Env('raw_label'))
......
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