title: Configuring proxies on Python + Selenium + Firefox WebDriver
body: <p>I can't connect using proxies via Selenium Firefox WebDriver.</p>
  
  <p>With this configuration, the connection is generated but NOT via the proxy but the local server.</p>
  
  <p>There are two questions on this matter and <a href="https://docs.seleniumhq.org/docs/04_webdriver_advanced.jsp#using-a-proxy" rel="nofollow noreferrer">this documentation,</a> but none seem to have solved this for python3:</p>
  
  <pre><code>def selenium_connect():
  
      proxy = "178.20.231.218"
      proxy_port = 80
      url = "https://www.whatsmyip.org/"
  
      fp = webdriver.FirefoxProfile()
      # Direct = 0, Manual = 1, PAC = 2, AUTODETECT = 4, SYSTEM = 5
      fp.set_preference("network.proxy.type", 1)
      fp.set_preference("network.proxy.http",proxy)
      fp.set_preference("network.proxy.http_port",proxy_port)
      fp.update_preferences()
      driver = webdriver.Firefox(firefox_profile=fp)
      driver.get(url)
  </code></pre>
  
  <p>I'm using Firefox webdriver version 52.0.2 and Python 3.7 and a standard Ubuntu 16.04 Docker environment. </p>