diff --git a/crawler/data_access.py b/crawler/data_access.py index 9ed4e7b..3e37e52 100644 --- a/crawler/data_access.py +++ b/crawler/data_access.py @@ -111,7 +111,7 @@ class Listing: "estimated_sqm": estimated_sqm, "text": model_output, } - ) + ) with open(self.path_floorplan_ocr_json(), "w") as f: json.dump(objs, f) @@ -223,6 +223,17 @@ class Listing: except: print(self.identifier) return False + + @property + def isRemoved(self) -> bool: + return not self.detailobject["property"]["visible"] + + @property + def status(self) -> str: + if self.isRemoved: + return 'removed' + status = self.detailobject["property"]["status"] + return status def dict_nicely(self): return { @@ -243,6 +254,7 @@ class Listing: "development": self.development, "tenure_type": self.tenure_type, "updated_days": self.updateDaysAgo, + "status": self.status, }