mirror of
https://github.com/Bunsly/HomeHarvest.git
synced 2026-03-05 03:54:29 -08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
00537329cf | ||
|
|
a9225b532f |
@@ -47,7 +47,7 @@ filename = f"HomeHarvest_{current_timestamp}.csv"
|
||||
properties = scrape_property(
|
||||
location="San Diego, CA",
|
||||
listing_type="sold", # or (for_sale, for_rent)
|
||||
property_younger_than=30, # sold in last 30 days - listed in last x days if (for_sale, for_rent)
|
||||
past_days=30, # sold in last 30 days - listed in last x days if (for_sale, for_rent)
|
||||
# pending_or_contingent=True # use on for_sale listings to find pending / contingent listings
|
||||
# mls_only=True, # only fetch MLS listings
|
||||
# proxy="http://user:pass@host:port" # use a proxy to change your IP address
|
||||
|
||||
@@ -8,7 +8,7 @@ filename = f"HomeHarvest_{current_timestamp}.csv"
|
||||
properties = scrape_property(
|
||||
location="San Diego, CA",
|
||||
listing_type="sold", # or (for_sale, for_rent)
|
||||
property_younger_than=30, # sold in last 30 days - listed in last x days if (for_sale, for_rent)
|
||||
past_days=30, # sold in last 30 days - listed in last x days if (for_sale, for_rent)
|
||||
# pending_or_contingent=True # use on for_sale listings to find pending / contingent listings
|
||||
# mls_only=True, # only fetch MLS listings
|
||||
# proxy="http://user:pass@host:port" # use a proxy to change your IP address
|
||||
|
||||
@@ -12,7 +12,7 @@ def scrape_property(
|
||||
listing_type: str = "for_sale",
|
||||
radius: float = None,
|
||||
mls_only: bool = False,
|
||||
property_younger_than: int = None,
|
||||
past_days: int = None,
|
||||
pending_or_contingent: bool = False,
|
||||
proxy: str = None,
|
||||
) -> pd.DataFrame:
|
||||
@@ -22,7 +22,7 @@ def scrape_property(
|
||||
:param listing_type: Listing Type (for_sale, for_rent, sold)
|
||||
:param radius: Get properties within _ (e.g. 1.0) miles. Only applicable for individual addresses.
|
||||
:param mls_only: If set, fetches only listings with MLS IDs.
|
||||
:param property_younger_than: Get properties sold/listed in last _ days.
|
||||
:param past_days: Get properties sold or listed (dependent on your listing_type) in the last _ days.
|
||||
:param pending_or_contingent: If set, fetches only pending or contingent listings. Only applicable for for_sale listings from general area searches.
|
||||
:param proxy: Proxy to use for scraping
|
||||
"""
|
||||
@@ -34,7 +34,7 @@ def scrape_property(
|
||||
proxy=proxy,
|
||||
radius=radius,
|
||||
mls_only=mls_only,
|
||||
last_x_days=property_younger_than,
|
||||
last_x_days=past_days,
|
||||
pending_or_contingent=pending_or_contingent,
|
||||
)
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ def main():
|
||||
radius=args.radius,
|
||||
proxy=args.proxy,
|
||||
mls_only=args.mls_only,
|
||||
property_younger_than=args.days,
|
||||
past_days=args.days,
|
||||
pending_or_contingent=args.pending_or_contingent,
|
||||
)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "homeharvest"
|
||||
version = "0.3.1"
|
||||
version = "0.3.2"
|
||||
description = "Real estate scraping library supporting Zillow, Realtor.com & Redfin."
|
||||
authors = ["Zachary Hampton <zachary@zacharysproducts.com>", "Cullen Watson <cullen@cullen.ai>"]
|
||||
homepage = "https://github.com/ZacharyHampton/HomeHarvest"
|
||||
|
||||
@@ -29,7 +29,7 @@ def test_realtor_comps():
|
||||
result = scrape_property(
|
||||
location="2530 Al Lipscomb Way",
|
||||
radius=0.5,
|
||||
property_younger_than=180,
|
||||
past_days=180,
|
||||
listing_type="sold",
|
||||
)
|
||||
|
||||
@@ -38,11 +38,11 @@ def test_realtor_comps():
|
||||
|
||||
def test_realtor_last_x_days_sold():
|
||||
days_result_30 = scrape_property(
|
||||
location="Dallas, TX", listing_type="sold", property_younger_than=30
|
||||
location="Dallas, TX", listing_type="sold", past_days=30
|
||||
)
|
||||
|
||||
days_result_10 = scrape_property(
|
||||
location="Dallas, TX", listing_type="sold", property_younger_than=10
|
||||
location="Dallas, TX", listing_type="sold", past_days=10
|
||||
)
|
||||
|
||||
assert all(
|
||||
|
||||
Reference in New Issue
Block a user