diff --git a/homeharvest/__init__.py b/homeharvest/__init__.py index c3005a0..117d56c 100644 --- a/homeharvest/__init__.py +++ b/homeharvest/__init__.py @@ -53,7 +53,9 @@ def scrape_property( if not properties_dfs: return pd.DataFrame() + properties_dfs = [df for df in properties_dfs if not df.empty] + with warnings.catch_warnings(): warnings.simplefilter("ignore", category=FutureWarning) - return pd.concat(properties_dfs, ignore_index=True, axis=0)[ordered_properties].replace({"None": "", None: ""}) + return pd.concat(properties_dfs, ignore_index=True, axis=0)[ordered_properties].replace({"None": pd.NA, None: pd.NA, "": pd.NA}) diff --git a/homeharvest/core/scrapers/models.py b/homeharvest/core/scrapers/models.py index afac3e1..b2dd822 100644 --- a/homeharvest/core/scrapers/models.py +++ b/homeharvest/core/scrapers/models.py @@ -36,6 +36,7 @@ class PropertyType(Enum): CONDO_TOWNHOME = "CONDO_TOWNHOME" CONDO_TOWNHOME_ROWHOME_COOP = "CONDO_TOWNHOME_ROWHOME_COOP" CONDO = "CONDO" + CONDOP = "CONDOP" CONDOS = "CONDOS" COOP = "COOP" DUPLEX_TRIPLEX = "DUPLEX_TRIPLEX" diff --git a/homeharvest/core/scrapers/realtor/__init__.py b/homeharvest/core/scrapers/realtor/__init__.py index a80e3dc..54063b5 100644 --- a/homeharvest/core/scrapers/realtor/__init__.py +++ b/homeharvest/core/scrapers/realtor/__init__.py @@ -806,7 +806,7 @@ class RealtorScraper(Scraper): return Description( primary_photo=primary_photo, alt_photos=RealtorScraper.process_alt_photos(result.get("photos")), - style=PropertyType(style) if style else None, + 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"), baths_half=description_data.get("baths_half"), diff --git a/pyproject.toml b/pyproject.toml index f51150e..787b6e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "homeharvest" -version = "0.3.23" +version = "0.3.24" description = "Real estate scraping library" authors = ["Zachary Hampton ", "Cullen Watson "] homepage = "https://github.com/Bunsly/HomeHarvest"