Skip to content

Commit

Permalink
fix: keyerror on address
Browse files Browse the repository at this point in the history
  • Loading branch information
cullenwatson committed Sep 19, 2023
1 parent eae8108 commit 043f091
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions homeharvest/core/scrapers/redfin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,21 @@ def get_value(key: str) -> Any | None:
unit = parse_unit(get_value("streetLine"))
address = Address(
street_address=street_address,
city=home["city"],
state=home["state"],
zip_code=home["zip"],
city=home.get("city"),
state=home.get("state"),
zip_code=home.get("zip"),
unit=unit,
country="USA",
)
else:
address_info = home["streetAddress"]
street_address, unit = parse_address_two(address_info["assembledAddress"])
address_info = home.get("streetAddress")
street_address, unit = parse_address_two(address_info.get("assembledAddress"))

address = Address(
street_address=street_address,
city=home["city"],
state=home["state"],
zip_code=home["zip"],
city=home.get("city"),
state=home.get("state"),
zip_code=home.get("zip"),
unit=unit,
country="USA",
)
Expand Down

0 comments on commit 043f091

Please sign in to comment.