Chrome’s --proxy-server argument applies after the browser starts. webdriver-manager may need a proxy earlier, while looking up a compatible driver and downloading its archive.

import requests
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.core.download_manager import WDMDownloadManager
from webdriver_manager.core.http import HttpClient

class ProxyHttpClient(HttpClient):
    def __init__(self, session):
        self.session = session

    def get(self, url, params=None, **kwargs):
        kwargs.setdefault('timeout', 30)
        response = self.session.get(url, params=params, **kwargs)
        self.validate_response(response)
        return response

with requests.Session() as session:
    session.trust_env = False
    session.proxies.update({
        'http': 'http://proxy.example:8080',
        'https': 'http://proxy.example:8080',
    })
    downloader = WDMDownloadManager(ProxyHttpClient(session))
    driver_path = ChromeDriverManager(download_manager=downloader).install()

This fragment assumes the existing webdriver-manager and Requests dependencies. The selected proxy listener is HTTP for both destination schemes. For permitted public driver downloads, the HTTP proxy list supplies candidates for the session’s proxy URLs. Keep the Session alive until the manager’s installation or cache lookup has completed, then pass driver_path to the application’s normal Selenium service setup.

The custom get method accepts the manager’s additional HTTP arguments and preserves response validation. Its proxy choice belongs to the download client; configure Chrome separately when navigation also needs a proxy.

trust_env=False makes this Session’s configuration explicit, including disabling environment-derived CA bundle selection. If the download route requires an organization CA, provide the intended bundle on this Session’s verify setting while retaining certificate checks.

Аффингæй хæстæг статьялтæ