From 0d70007000d4fa96f605e6151a50289c96879c50 Mon Sep 17 00:00:00 2001 From: Zachary Hampton <69336300+ZacharyHampton@users.noreply.github.com> Date: Thu, 16 May 2024 23:04:07 -0700 Subject: [PATCH] - alt photos bug fix --- homeharvest/core/scrapers/realtor/__init__.py | 4 ++-- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeharvest/core/scrapers/realtor/__init__.py b/homeharvest/core/scrapers/realtor/__init__.py index 7163f4b..8fd596f 100644 --- a/homeharvest/core/scrapers/realtor/__init__.py +++ b/homeharvest/core/scrapers/realtor/__init__.py @@ -166,7 +166,7 @@ def handle_listing(self, listing_id: str) -> list[Property]: longitude=property_info["address"]["location"]["coordinate"].get("lon") if able_to_get_lat_long else None, address=self._parse_address(property_info, search_type="handle_listing"), description=Description( - alt_photos=self.process_alt_photos(property_info.get("media", {}).get("photos", [])), + alt_photos=self.process_alt_photos(property_info["media"].get("photos", [])) if property_info.get("media") else None, style=property_info["basic"].get("type", "").upper(), beds=property_info["basic"].get("beds"), baths_full=property_info["basic"].get("baths_full"), @@ -805,7 +805,7 @@ def _parse_description(result: dict) -> Description: return Description( primary_photo=primary_photo, - alt_photos=RealtorScraper.process_alt_photos(result.get("photos")), + alt_photos=RealtorScraper.process_alt_photos(result.get("photos", [])), style=PropertyType.__getitem__(style) if style and style in PropertyType.__members__ else None, beds=description_data.get("beds"), baths_full=description_data.get("baths_full"), diff --git a/pyproject.toml b/pyproject.toml index e7b007a..6c23a3e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "homeharvest" -version = "0.3.25" +version = "0.3.26" description = "Real estate scraping library" authors = ["Zachary Hampton ", "Cullen Watson "] homepage = "https://github.com/Bunsly/HomeHarvest"