Add integration tests for requests with proxy param

This commit is contained in:
ngosang
2023-05-23 22:13:52 +02:00
parent efaa5f31b6
commit 3c97c9603a
5 changed files with 109 additions and 11 deletions

View File

@@ -36,7 +36,7 @@ def get_flaresolverr_version() -> str:
return FLARESOLVERR_VERSION
def get_webdriver(proxyconf: dict=None) -> WebDriver:
def get_webdriver(proxy: dict = None) -> WebDriver:
global PATCHED_DRIVER_PATH
logging.debug('Launching web browser...')
@@ -55,8 +55,8 @@ def get_webdriver(proxyconf: dict=None) -> WebDriver:
options.add_argument('--ignore-certificate-errors')
options.add_argument('--ignore-ssl-errors')
if proxyconf:
proxy_url = proxyconf['url']
if proxy and 'url' in proxy:
proxy_url = proxy['url']
logging.debug("Using webdriver proxy: %s", proxy_url)
options.add_argument('--proxy-server=%s' % proxy_url)