Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98511

Python Selenium Gekodriver proxy not being applied

$
0
0

I'm trying to apply an HTTP proxy with authentication to a Selenium webdriver instance using geckodriver:

proxy_options = Proxy({
            'proxyType': ProxyType.MANUAL,
            'httpProxy': f"{self.sender['proxy_ip']}:{self.sender['proxy_port']}",
            'socks_username': self.sender['proxy_username'],
            'socks_password': self.sender['proxy_password']
        })

        profile = webdriver.FirefoxProfile()
        profile.set_preference("network.proxy.type", 1)
        profile.set_preference("network.proxy.http", self.sender['proxy_ip'])
        profile.set_preference("network.proxy.http_port", self.sender['proxy_port'])
        profile.set_preference("network.proxy.socks_username", self.sender['proxy_username'])
        profile.set_preference("network.proxy.socks_password", self.sender['proxy_password'])
        profile.update_preferences()
        self.browser = webdriver.Firefox(executable_path=GECKO_PATH, options=BROWSER_OPTS, proxy=proxy_options,
                                         firefox_profile=profile)

I have tried both the proxy option and the profile option. The browser navigates to a URL without applying any proxy.


Viewing all articles
Browse latest Browse all 98511

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>