From 9a0cac650e43091929b5118b2425cffbb57e64a9 Mon Sep 17 00:00:00 2001 From: zacharyhampton Date: Sun, 21 Dec 2025 16:22:03 -0700 Subject: [PATCH] Version bump to 0.8.16 --- homeharvest/core/scrapers/realtor/__init__.py | 13 +++++++++---- homeharvest/core/scrapers/realtor/queries.py | 2 ++ pyproject.toml | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/homeharvest/core/scrapers/realtor/__init__.py b/homeharvest/core/scrapers/realtor/__init__.py index 9bb3dc9..1fc95f8 100644 --- a/homeharvest/core/scrapers/realtor/__init__.py +++ b/homeharvest/core/scrapers/realtor/__init__.py @@ -126,9 +126,14 @@ class RealtorScraper(Scraper): } if geo.get("area_type") == "address": - geo_id = geo.get("_id", "") - if geo_id.startswith("addr:"): - result["mpr_id"] = geo_id.replace("addr:", "") + # Try to get mpr_id directly from API response first + if geo.get("mpr_id"): + result["mpr_id"] = geo.get("mpr_id") + else: + # Fallback: extract from _id field if it has addr: prefix + geo_id = geo.get("_id", "") + if geo_id.startswith("addr:"): + result["mpr_id"] = geo_id.replace("addr:", "") return result @@ -169,7 +174,7 @@ class RealtorScraper(Scraper): """%s query GetHomeDetails($property_id: ID!) { home(property_id: $property_id) { - ...HomeDetailsFragment + ...SearchFragment } }""" % HOME_FRAGMENT diff --git a/homeharvest/core/scrapers/realtor/queries.py b/homeharvest/core/scrapers/realtor/queries.py index 4dcee0f..70bcf15 100644 --- a/homeharvest/core/scrapers/realtor/queries.py +++ b/homeharvest/core/scrapers/realtor/queries.py @@ -721,6 +721,7 @@ SEARCH_SUGGESTIONS_QUERY = """query Search_suggestions($searchInput: SearchSugge geo { _id _score + mpr_id area_type city state_code @@ -764,6 +765,7 @@ SEARCH_SUGGESTIONS_QUERY = """query Search_suggestions($searchInput: SearchSugge geo { _id _score + mpr_id area_type city state_code diff --git a/pyproject.toml b/pyproject.toml index d918d17..558797f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "homeharvest" -version = "0.8.15" +version = "0.8.16" description = "Real estate scraping library" authors = ["Zachary Hampton ", "Cullen Watson "] homepage = "https://github.com/ZacharyHampton/HomeHarvest"