Commit a08cce0d authored by Christophe Francois's avatar Christophe Francois Committed by Vincent A

[netfinca] Fix iter_investment

The unitvalue contains a valuation hour or date, so the CleanDecimal
didn't work.

The regex for the unitprice was bad and didn't work with thousands (it's
the French format so they're separated by a space which didn't match the
regex).
parent dab06241
......@@ -150,7 +150,7 @@ def obj_unitprice(self):
return CleanDecimal.French(
Regexp(
CleanText(TableCell('unitprice')),
r'([0-9]+,[0-9]+)',
r'(.*)(?:\(.*\))?',
default=NotAvailable
),
default=NotAvailable
......@@ -246,7 +246,8 @@ def original_unitvalue(self):
return (NotAvailable, NotAvailable)
return (
Base(tablecell, Currency('.', default=NotAvailable))(self),
Base(tablecell, CleanDecimal.French('.', default=NotAvailable))(self)
# The cell also contains a <span> child with the hour of valuation, it must be ignored by the xpath
Base(tablecell, CleanDecimal.French('text()', default=NotAvailable))(self),
)
def get_liquidity(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