Skip to content
Commits on Source (2)
...@@ -139,7 +139,7 @@ class ResultsPage(HTMLPage): ...@@ -139,7 +139,7 @@ class ResultsPage(HTMLPage):
@method @method
class iter_events(ListElement): class iter_events(ListElement):
item_xpath = '//table[@id="preliste"]/tr' item_xpath = '//table[@id="preliste"]/tr'
next_page = AbsoluteLink('(//a[text()=">"][contains(@href,"LISTEPEpg")])[1]') next_page = AbsoluteLink('(//a[img[contains(@src,"btnPageSuivanteSmall")]])[1]')
class item(ItemElement): class item(ItemElement):
klass = BREvent klass = BREvent
......
...@@ -64,7 +64,10 @@ def iter_investment(self): ...@@ -64,7 +64,10 @@ def iter_investment(self):
yield self.page.get_liquidities() yield self.page.get_liquidities()
for inv in self.page.iter_funded(): for inv in self.page.iter_funded_bond():
yield inv
for inv in self.page.iter_funded_stock():
yield inv yield inv
for inv in self.page.iter_funding(): for inv in self.page.iter_funding():
......
...@@ -58,7 +58,7 @@ def get_liquidities(self): ...@@ -58,7 +58,7 @@ def get_liquidities(self):
return create_french_liquidity(value) return create_french_liquidity(value)
@method @method
class iter_funded(TableElement): class iter_funded_stock(TableElement):
item_xpath = '//table[@id="portefeuilleAction"]/tbody/tr' item_xpath = '//table[@id="portefeuilleAction"]/tbody/tr'
head_xpath = '//table[@id="portefeuilleAction"]/thead//th' head_xpath = '//table[@id="portefeuilleAction"]/thead//th'
...@@ -81,11 +81,31 @@ class item(ItemElement): ...@@ -81,11 +81,31 @@ class item(ItemElement):
Regexp(CleanText(TableCell('diff_ratio')), r'^000(\d+)\b') Regexp(CleanText(TableCell('diff_ratio')), r'^000(\d+)\b')
) )
# unitprice and unitvalue are on a dedicated page, let's forget it @method
class iter_funded_bond(TableElement):
item_xpath = '//div[@id="panel-OBLIGATIONS"]//table[has-class("portefeuille-liste")]/tbody/tr'
head_xpath = '//div[@id="panel-OBLIGATIONS"]//table[has-class("portefeuille-liste")]/thead//th'
col_bought = 'Vous avez investi'
col_label = 'Investissement dans'
class item(ItemElement):
klass = Investment
obj_label = CleanText(TableCell('label'))
obj_valuation = CleanDecimal.SI(
Regexp(CleanText(TableCell('bought')), r'^000(\d+)\b')
)
@method @method
class iter_funding(TableElement): class iter_funding(TableElement):
item_xpath = '//table[has-class("portefeuille-liste") and not(@id)]/tbody/tr' def find_elements(self):
for el in self.page.doc.xpath('//div[has-class("panel")]'):
if 'souscription(s) en cours' in CleanText('.')(el):
for sub in el.xpath('.//table[has-class("portefeuille-liste") and not(@id)]/tbody/tr'):
yield sub
return
head_xpath = '//table[has-class("portefeuille-liste") and not(@id)]/thead//th' head_xpath = '//table[has-class("portefeuille-liste") and not(@id)]/thead//th'
col_label = 'Opération / Cible' col_label = 'Opération / Cible'
......