Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
woob
woob
Compare revisions
282e465ca2e5852245ce2d6232fba20ea7c8986f to 6e7fd9864491250fa54d5a12fa8fcb248f1ce5fd
Commits on Source (2)
[billetreduc] pagination changed
· 0e1ab7ff
hydrargyrum
authored
Dec 04, 2019
0e1ab7ff
[wiseed] support bonds and improve "funding" xpath
· 6e7fd986
hydrargyrum
authored
Dec 04, 2019
6e7fd986
Hide whitespace changes
Inline
Side-by-side
modules/billetreduc/pages.py
View file @
6e7fd986
...
@@ -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
...
...
modules/wiseed/browser.py
View file @
6e7fd986
...
@@ -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
():
...
...
modules/wiseed/pages.py
View file @
6e7fd986
...
@@ -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
'
...
...