From a3c5e9060e12e381e7d585a45a4a6e4eaa97b686 Mon Sep 17 00:00:00 2001 From: zachary Date: Sat, 3 May 2025 13:55:56 -0700 Subject: [PATCH] - updated queries --- homeharvest/core/scrapers/realtor/__init__.py | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/homeharvest/core/scrapers/realtor/__init__.py b/homeharvest/core/scrapers/realtor/__init__.py index fe386f3..64f0a23 100644 --- a/homeharvest/core/scrapers/realtor/__init__.py +++ b/homeharvest/core/scrapers/realtor/__init__.py @@ -305,15 +305,20 @@ class RealtorScraper(Scraper): ) elif search_type == "area": #: general search, came from a general location query = """query Home_search( - $location: String!, + $city: String, + $county: [String], + $state_code: String, + $postal_code: String $offset: Int, ) { home_search( query: { %s - search_location: {location: $location} + city: $city + county: $county + postal_code: $postal_code + state_code: $state_code status: %s - unique: true %s %s %s @@ -432,14 +437,18 @@ class RealtorScraper(Scraper): "radius": "{}mi".format(self.radius), } - #: elif location_type == "postal_code": - #: search_variables |= { - #: "postal_code": location_info.get("postal_code"), - #: } + elif location_type == "postal_code": + search_variables |= { + "postal_code": location_info.get("postal_code"), + } else: #: general search, location search_variables |= { - "location": self.location, + "city": location_info.get("city"), + "county": location_info.get("county"), + "state_code": location_info.get("state_code"), + "postal_code": location_info.get("postal_code"), + } if self.foreclosure: