Skip to content

Commit 8a0e780

Browse files
Merge pull request #564 from brokenjade3000/patch-1
The current httpx doesn't support proxies arguments:
2 parents 602446d + 1b065ee commit 8a0e780

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)