Skip to content

Commit df1c262

Browse files
The current httpx doesn't support proxies arguments:
https://github.com/encode/httpx/blob/master/httpx/_client.py#L239
1 parent 9269ff3 commit df1c262

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
@@ -483,6 +483,10 @@ def _new_session(self, **kwargs):
483483
# ScraperAPI requests to work.
484484
# https://www.scraperapi.com/documentation/
485485
init_kwargs["verify"] = False
486+
if 'proxies' in init_kwargs:
487+
proxy=init_kwargs['proxies']['https://']
488+
del init_kwargs['proxies']
489+
init_kwargs['proxy'] = proxy
486490
self._session = httpx.Client(**init_kwargs)
487491
self._webdriver = None
488492

0 commit comments

Comments
 (0)