- invalid test cases

- redfin and realtor bug fixes
- dupe check bug fix
This commit is contained in:
Zachary Hampton
2023-09-18 20:28:03 -07:00
parent e1917009ae
commit 3ec47c5b6a
7 changed files with 64 additions and 6 deletions

View File

@@ -44,7 +44,7 @@ class RealtorScraper(Scraper):
result = response_json["autocomplete"]
if result is None:
if not result:
raise NoResultsFound("No results found for location: " + self.location)
return result[0]

View File

@@ -3,6 +3,7 @@ from typing import Any
from .. import Scraper
from ....utils import parse_address_two, parse_unit
from ..models import Property, Address, PropertyType
from ....exceptions import NoResultsFound
class RedfinScraper(Scraper):
@@ -26,6 +27,9 @@ class RedfinScraper(Scraper):
elif match_type == "1":
return "address" #: address, needs to be handled differently
if "exactMatch" not in response_json['payload']:
raise NoResultsFound("No results found for location: {}".format(self.location))
if response_json["payload"]["exactMatch"] is not None:
target = response_json["payload"]["exactMatch"]
else:

View File

@@ -2,7 +2,7 @@ import re
import json
from .. import Scraper
from ....utils import parse_address_two, parse_unit
from ....exceptions import GeoCoordsNotFound
from ....exceptions import GeoCoordsNotFound, NoResultsFound
from ..models import Property, Address, ListingType, PropertyType, SiteName
@@ -151,9 +151,6 @@ class ZillowScraper(Scraper):
else None,
"currency": home_info["currency"],
"price": home_info.get("price"),
"square_feet": int(home_info["livingArea"])
if "livingArea" in home_info
else None,
"tax_assessed_value": int(home_info["taxAssessedValue"])
if "taxAssessedValue" in home_info
else None,