fix: keyerror on address
parent
eae8108978
commit
043f091158
|
@ -49,21 +49,21 @@ class RedfinScraper(Scraper):
|
||||||
unit = parse_unit(get_value("streetLine"))
|
unit = parse_unit(get_value("streetLine"))
|
||||||
address = Address(
|
address = Address(
|
||||||
street_address=street_address,
|
street_address=street_address,
|
||||||
city=home["city"],
|
city=home.get("city"),
|
||||||
state=home["state"],
|
state=home.get("state"),
|
||||||
zip_code=home["zip"],
|
zip_code=home.get("zip"),
|
||||||
unit=unit,
|
unit=unit,
|
||||||
country="USA",
|
country="USA",
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
address_info = home["streetAddress"]
|
address_info = home.get("streetAddress")
|
||||||
street_address, unit = parse_address_two(address_info["assembledAddress"])
|
street_address, unit = parse_address_two(address_info.get("assembledAddress"))
|
||||||
|
|
||||||
address = Address(
|
address = Address(
|
||||||
street_address=street_address,
|
street_address=street_address,
|
||||||
city=home["city"],
|
city=home.get("city"),
|
||||||
state=home["state"],
|
state=home.get("state"),
|
||||||
zip_code=home["zip"],
|
zip_code=home.get("zip"),
|
||||||
unit=unit,
|
unit=unit,
|
||||||
country="USA",
|
country="USA",
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue