Skip to content

Commit

Permalink
Merge pull request #12 from ZacharyHampton/proxy_bug
Browse files Browse the repository at this point in the history
fix: proxy add to session correctly
  • Loading branch information
ZacharyHampton authored Sep 19, 2023
2 parents 9aaabdd + 8f06d46 commit 0a39357
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion homeharvest/core/scrapers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ def __init__(self, scraper_input: ScraperInput):
self.location = scraper_input.location
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.site_name = scraper_input.site_name

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "homeharvest"
version = "0.2.4"
version = "0.2.5"
description = "Real estate scraping library supporting Zillow, Realtor.com & Redfin."
authors = ["Zachary Hampton <[email protected]>", "Cullen Watson <[email protected]>"]
homepage = "https://github.com/ZacharyHampton/HomeHarvest"
Expand Down

0 comments on commit 0a39357

Please sign in to comment.