Compare commits

...

6 Commits

Author SHA1 Message Date
Cullen Watson
e8d9235ee6 chore: update version number 2023-09-19 16:43:59 -05:00
Cullen Watson
043f091158 fix: keyerror on address 2023-09-19 16:43:17 -05:00
Cullen Watson
eae8108978 docs: change cmd 2023-09-19 16:18:01 -05:00
Zachary Hampton
0a39357a07 Merge pull request #12 from ZacharyHampton/proxy_bug
fix: proxy add to session correctly
2023-09-19 14:07:25 -07:00
Cullen Watson
8f06d46ddb chore: version number 2023-09-19 16:07:06 -05:00
Cullen Watson
0dae14ccfc fix: proxy add to session correctly 2023-09-19 16:05:14 -05:00
4 changed files with 19 additions and 12 deletions

View File

@@ -17,7 +17,7 @@
## Installation ## Installation
```bash ```bash
pip install --force-reinstall homeharvest pip install homeharvest
``` ```
_Python version >= [3.10](https://www.python.org/downloads/release/python-3100/) required_ _Python version >= [3.10](https://www.python.org/downloads/release/python-3100/) required_

View File

@@ -16,7 +16,14 @@ class Scraper:
self.location = scraper_input.location self.location = scraper_input.location
self.listing_type = scraper_input.listing_type self.listing_type = scraper_input.listing_type
self.session = requests.Session(proxies=scraper_input.proxy) self.session = requests.Session()
if scraper_input.proxy:
proxy_url = scraper_input.proxy
proxies = {
"http": proxy_url,
"https": proxy_url
}
self.session.proxies.update(proxies)
self.listing_type = scraper_input.listing_type self.listing_type = scraper_input.listing_type
self.site_name = scraper_input.site_name self.site_name = scraper_input.site_name

View File

@@ -49,21 +49,21 @@ class RedfinScraper(Scraper):
unit = parse_unit(get_value("streetLine")) unit = parse_unit(get_value("streetLine"))
address = Address( address = Address(
street_address=street_address, street_address=street_address,
city=home["city"], city=home.get("city"),
state=home["state"], state=home.get("state"),
zip_code=home["zip"], zip_code=home.get("zip"),
unit=unit, unit=unit,
country="USA", country="USA",
) )
else: else:
address_info = home["streetAddress"] address_info = home.get("streetAddress")
street_address, unit = parse_address_two(address_info["assembledAddress"]) street_address, unit = parse_address_two(address_info.get("assembledAddress"))
address = Address( address = Address(
street_address=street_address, street_address=street_address,
city=home["city"], city=home.get("city"),
state=home["state"], state=home.get("state"),
zip_code=home["zip"], zip_code=home.get("zip"),
unit=unit, unit=unit,
country="USA", country="USA",
) )

View File

@@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "homeharvest" name = "homeharvest"
version = "0.2.4" version = "0.2.6"
description = "Real estate scraping library supporting Zillow, Realtor.com & Redfin." description = "Real estate scraping library supporting Zillow, Realtor.com & Redfin."
authors = ["Zachary Hampton <zachary@zacharysproducts.com>", "Cullen Watson <cullen@cullen.ai>"] authors = ["Zachary Hampton <zachary@zacharysproducts.com>", "Cullen Watson <cullen@cullen.ai>"]
homepage = "https://github.com/ZacharyHampton/HomeHarvest" homepage = "https://github.com/ZacharyHampton/HomeHarvest"