Skip to content

Commit 1b065ee

Browse files
brokenjade3000arunkannawadi
authored andcommitted
The current httpx doesn't support proxies arguments:
https://github.com/encode/httpx/blob/master/httpx/_client.py#L239
1 parent 602446d commit 1b065ee

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

scholarly/_proxy_generator.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,10 @@ def _new_session(self, **kwargs):
485485
# ScraperAPI requests to work.
486486
# https://www.scraperapi.com/documentation/
487487
init_kwargs["verify"] = False
488+
if 'proxies' in init_kwargs:
489+
proxy=init_kwargs['proxies']['https://']
490+
del init_kwargs['proxies']
491+
init_kwargs['proxy'] = proxy
488492
self._session = httpx.Client(**init_kwargs)
489493
self._webdriver = None
490494

0 commit comments

Comments
 (0)