Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
weboob
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Guillaume Duveau
weboob
Commits
be4331d1
Commit
be4331d1
authored
Jul 19, 2019
by
Guntra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[lesterrains] better selection of extreme values
parent
97ccbff0
Pipeline
#2560
created with stages
Changes
1
Pipelines
4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
29 deletions
+19
-29
modules/lesterrains/pages.py
modules/lesterrains/pages.py
+19
-29
No files found.
modules/lesterrains/pages.py
View file @
be4331d1
...
...
@@ -97,15 +97,12 @@ class SearchPage(HTMLPage):
default
=
0
)
)(
self
)
if
max_area
>
min_area
:
return
max_area
else
:
return
min_area
return
max
(
min_area
,
max_area
)
obj_cost
=
CleanDecimal
(
CleanText
(
'.//div[@class="presentationItem"]/h3/span[1]'
,
replace
=
[(
"."
,
""
)
,(
" €"
,
""
)
],
replace
=
[(
"."
,
""
)],
default
=
NotAvailable
)
)
...
...
@@ -161,34 +158,27 @@ class HousingPage(HTMLPage):
)
def
obj_area
(
self
):
max_area
=
0
areas
=
[]
for
land
in
self
.
xpath
(
'//table[@id="price-list"]/tbody/tr'
):
area
=
CleanDecimal
(
CleanText
(
'./td[2]'
,
replace
=
[(
"m²"
,
""
)],
default
=
0
)
)(
land
)
if
area
>
max_area
:
max_area
=
area
return
max_area
areas
.
append
(
CleanDecimal
(
'./td[2]'
)(
land
)
)
return
max
(
areas
)
def
obj_cost
(
self
):
min_cost
=
0
prices
=
[]
for
land
in
self
.
xpath
(
'//table[@id="price-list"]/tbody/tr'
):
cost
=
CleanDecimal
(
CleanText
(
'./td[3]'
,
replace
=
[(
"."
,
""
)],
default
=
0
)
)(
land
)
if
min_cost
==
0
:
min_cost
=
cost
if
cost
<
min_cost
:
min_cost
=
cost
return
min_cost
prices
.
append
(
CleanDecimal
(
CleanText
(
'./td[3]'
,
replace
=
[(
"."
,
""
)]
)
)(
land
)
)
return
min
(
prices
)
obj_currency
=
Currency
.
get_currency
(
'€'
)
obj_date
=
Date
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment