2

I am currently trying to use user:pass proxies in selenium in firefox, but the solution in the docs is not working

from selenium import webdriver
from selenium.webdriver.common.proxy import Proxy, ProxyType

myProxy = "host:port"
Proxy({
    'proxyType': ProxyType.MANUAL,
    'httpProxy': myProxy,
    'ftpProxy': myProxy,
    'sslProxy': myProxy,
    'noProxy': '' # set this value as desired
    })

driver = webdriver.Firefox(r'''C:\Users\ben_s\Desktop\geckodriver''',proxy=proxy)
driver.get("https://www.ipchicken.com/")

Is there a way this code could be tweaked to make the proxy work? Or is there an entierly different method? Thanks

Ben S.
  • 111
  • 1
  • 8
  • 1
    Possible duplicate of [How to set proxy authentication (user & password) using python selenium](https://stackoverflow.com/questions/38304253/how-to-set-proxy-authentication-user-password-using-python-selenium) – GPT14 Jul 30 '18 at 04:17

1 Answers1

0

Check out selenium-wire as proposed by this answer here. It works nicely for me.

Robert
  • 1,357
  • 15
  • 26