mirror of
https://github.com/Bunsly/HomeHarvest.git
synced 2026-03-04 19:44:29 -08:00
- invalid test cases
- redfin and realtor bug fixes - dupe check bug fix
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user