fix: KeyEror : [minBaths]

redfin
Cullen Watson 2023-09-21 13:06:06 -05:00
parent 8f37bfdeb8
commit c25961eded
2 changed files with 6 additions and 6 deletions

View File

@ -198,18 +198,18 @@ class ZillowScraper(Scraper):
site_name=self.site_name, site_name=self.site_name,
property_type=PropertyType("BUILDING"), property_type=PropertyType("BUILDING"),
listing_type=ListingType(result["statusType"]), listing_type=ListingType(result["statusType"]),
img_src=result["imgSrc"], img_src=result.get("imgSrc"),
address=self._extract_address(result["address"]), address=self._extract_address(result["address"]),
baths_min=result["minBaths"], baths_min=result.get("minBaths"),
area_min=result.get("minArea"), area_min=result.get("minArea"),
bldg_name=result.get("communityName"), bldg_name=result.get("communityName"),
status_text=result["statusText"], status_text=result["statusText"],
beds_min=result["minBeds"], beds_min=result["minBeds"],
price_min=price_value if "+/mo" in result["price"] else None, price_min=price_value if "+/mo" in result["price"] else None,
price_max=price_value if "+/mo" in result["price"] else None, price_max=price_value if "+/mo" in result["price"] else None,
latitude=result["latLong"]["latitude"], latitude=result.get("latLong", {}).get("latitude"),
longitude=result["latLong"]["longitude"], longitude=result.get("latLong", {}).get("longitude"),
unit_count=result["unitCount"], unit_count=result.get("unitCount"),
) )
properties_list.append(building_obj) properties_list.append(building_obj)

View File

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "homeharvest" name = "homeharvest"
version = "0.2.10" version = "0.2.11"
description = "Real estate scraping library supporting Zillow, Realtor.com & Redfin." description = "Real estate scraping library supporting Zillow, Realtor.com & Redfin."
authors = ["Zachary Hampton <zachary@zacharysproducts.com>", "Cullen Watson <cullen@cullen.ai>"] authors = ["Zachary Hampton <zachary@zacharysproducts.com>", "Cullen Watson <cullen@cullen.ai>"]
homepage = "https://github.com/ZacharyHampton/HomeHarvest" homepage = "https://github.com/ZacharyHampton/HomeHarvest"