mirror of
https://github.com/Bunsly/HomeHarvest.git
synced 2026-03-04 11:34:32 -08:00
[enh]: make last_x_days generic
add mls_only make radius generic
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# scrapes all 3 sites by default\n",
|
||||
"# check for sale properties\n",
|
||||
"scrape_property(\n",
|
||||
" location=\"dallas\",\n",
|
||||
" listing_type=\"for_sale\"\n",
|
||||
@@ -53,7 +53,6 @@
|
||||
"# search a specific address\n",
|
||||
"scrape_property(\n",
|
||||
" location=\"2530 Al Lipscomb Way\",\n",
|
||||
" site_name=\"zillow\",\n",
|
||||
" listing_type=\"for_sale\"\n",
|
||||
")"
|
||||
]
|
||||
@@ -68,7 +67,6 @@
|
||||
"# check rentals\n",
|
||||
"scrape_property(\n",
|
||||
" location=\"chicago, illinois\",\n",
|
||||
" site_name=[\"redfin\", \"zillow\"],\n",
|
||||
" listing_type=\"for_rent\"\n",
|
||||
")"
|
||||
]
|
||||
@@ -88,7 +86,6 @@
|
||||
"# check sold properties\n",
|
||||
"scrape_property(\n",
|
||||
" location=\"90210\",\n",
|
||||
" site_name=[\"redfin\"],\n",
|
||||
" listing_type=\"sold\"\n",
|
||||
")"
|
||||
]
|
||||
|
||||
18
examples/HomeHarvest_Demo.py
Normal file
18
examples/HomeHarvest_Demo.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from homeharvest import scrape_property
|
||||
from datetime import datetime
|
||||
|
||||
# Generate filename based on current timestamp
|
||||
current_timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
||||
filename = f"output/{current_timestamp}.csv"
|
||||
|
||||
properties = scrape_property(
|
||||
location="San Diego, CA",
|
||||
listing_type="sold", # for_sale, for_rent
|
||||
last_x_days=30, # sold/listed in last 30 days
|
||||
mls_only=True, # only fetch MLS listings
|
||||
)
|
||||
print(f"Number of properties: {len(properties)}")
|
||||
|
||||
# Export to csv
|
||||
properties.to_csv(filename, index=False)
|
||||
print(properties.head())
|
||||
Reference in New Issue
Block a user