- redfin bug fix

- .get
This commit is contained in:
Zachary Hampton
2023-09-21 11:27:12 -07:00
parent 9120cc9bfe
commit 05713c76b0
3 changed files with 11 additions and 11 deletions

View File

@@ -93,7 +93,7 @@ class RedfinScraper(Scraper):
year_built=get_value("yearBuilt") if not single_search else home["yearBuilt"],
lot_area_value=lot_size,
property_type=PropertyType.from_int_code(home.get("propertyType")),
price_per_sqft=get_value("pricePerSqFt"),
price_per_sqft=get_value("pricePerSqFt") if type(home.get("pricePerSqFt")) != int else home.get("pricePerSqFt"),
mls_id=get_value("mlsId"),
latitude=home["latLong"]["latitude"] if "latLong" in home and "latitude" in home["latLong"] else None,
longitude=home["latLong"]["longitude"] if "latLong" in home and "longitude" in home["latLong"] else None,
@@ -183,7 +183,7 @@ class RedfinScraper(Scraper):
),
property_url="https://www.redfin.com{}".format(building["url"]),
listing_type=self.listing_type,
unit_count=building["numUnitsForSale"],
unit_count=building.get("numUnitsForSale"),
)
def handle_address(self, home_id: str):