From 1b065eed19eba793daf638211e28f339397d31c9 Mon Sep 17 00:00:00 2001 From: brokenjade3000 Date: Sat, 8 Feb 2025 14:27:55 -0700 Subject: [PATCH] The current httpx doesn't support proxies arguments: https://github.com/encode/httpx/blob/master/httpx/_client.py#L239 --- scholarly/_proxy_generator.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scholarly/_proxy_generator.py b/scholarly/_proxy_generator.py index 2d2ec6f..3b37883 100644 --- a/scholarly/_proxy_generator.py +++ b/scholarly/_proxy_generator.py @@ -485,6 +485,10 @@ def _new_session(self, **kwargs): # ScraperAPI requests to work. # https://www.scraperapi.com/documentation/ init_kwargs["verify"] = False + if 'proxies' in init_kwargs: + proxy=init_kwargs['proxies']['https://'] + del init_kwargs['proxies'] + init_kwargs['proxy'] = proxy self._session = httpx.Client(**init_kwargs) self._webdriver = None