fix: lat/long KeyError

This commit is contained in:
Cullen Watson
2023-09-18 20:01:55 -05:00
parent 0621b01d9a
commit cc76e067b2
3 changed files with 5 additions and 5 deletions

View File

@@ -94,8 +94,8 @@ class RedfinScraper(Scraper):
price_per_sqft=get_value("pricePerSqFt"),
price=get_value("price"),
mls_id=get_value("mlsId"),
latitude=home["latLong"]["latitude"] if "latLong" in home else None,
longitude=home["latLong"]["longitude"] if "latLong" in home else None,
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
)
def _parse_building(self, building: dict) -> Property: