Skip to content

Commit 884f421

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 71e4ccf commit 884f421

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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)