Skip to content

Commit

Permalink
fix: update zillow xpath
Browse files Browse the repository at this point in the history
We were selecting on an xpath that 1) is not present if the house is for
sale, and 2) some time recently either disappeared or became an element
that is added to the DOM in frontend. This new xpath should fix both of
these problems.
  • Loading branch information
mikepqr committed Feb 20, 2022
1 parent d715397 commit f8da8ef
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = real-estate-scrape
version = 0.1.3
version = 0.1.4
description = Get the estimated value of a property from Redfin and Zillow
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down
17 changes: 15 additions & 2 deletions src/realestatescrape/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,21 @@
csvfile = "data.csv"
plotfile = "data.png"
sites = [
{"name": "redfin", "xpath": "//div[@class='statsValue']//span/text()"},
{"name": "zillow", "xpath": "//div[@id='home-details-home-values']//h3/text()"},
{
"name": "redfin",
"xpath": "//div[@class='statsValue']//span/text()",
},
{
"name": "zillow",
"xpath": (
# find the button containing "Zestimate"
"//button[contains(text(), 'Zestimate')]"
# find its parent
"/parent::node()"
# find its span descendent containing a "$"
"//span[contains(text(), '$')]/text()"
),
},
]


Expand Down

0 comments on commit f8da8ef

Please sign in to comment.