From f66007bc85ac2d4831f26024f6e9de9e77aeb0bf Mon Sep 17 00:00:00 2001 From: Kadir Date: Sun, 22 Sep 2024 11:31:32 +0100 Subject: [PATCH] adding status and other fields --- crawler/data_access.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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, }