diff --git a/modules/netfinca/pages.py b/modules/netfinca/pages.py index 435bdd52112e80b63104ef164c673442377bcd29..08afd5c57fb85e5ef290bf3a3cab441865d4c8fd 100644 --- a/modules/netfinca/pages.py +++ b/modules/netfinca/pages.py @@ -151,7 +151,11 @@ def obj_quantity(self): 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 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 div. If we didn't find code in url,