fix: proxy add to session correctly
parent
cdf41fe9f2
commit
0dae14ccfc
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue