Commit 7661dd80 authored by Quentin Defenouillere's avatar Quentin Defenouillere Committed by Vincent A

[netfinca] Handle specific class name for the last investment of the table

Some investment tables have a different xpath from the other ones for
the last line of the table.

Closes: 17649@zendesk
parent 3b6ed034
......@@ -151,7 +151,11 @@ class InvestmentsPage(LoggedPage, HTMLPage):
def obj_label(self):
tablecell = TableCell('label')(self)[0]
return CleanText(tablecell.xpath('./following-sibling::td[@class=""]/div/a')[0])(self)
tablecell_values = tablecell.xpath('./following-sibling::td[@class=""]/div/a')
if tablecell_values:
return CleanText(tablecell_values[0])(self)
# In rare cases the last invest of the table has a different <td> class name
return CleanText(tablecell.xpath('./following-sibling::td[has-class("last")]/div/a')[0])(self)
def obj_code(self):
# We try to get the code from <a> div. If we didn't find code in url,
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