title: How to use chomedriver with a proxy for selenium webdriver?
body: <p>Our network environment using a proxy server to connect to the outside internet, configured in IE => Internet Options => Connections => LAN Settings, like "10.212.20.11:8080".</p>
  
  <p>Now, I'm using selenium webdriver for chrome and IE, but with the proxy server enabled, I can't start the browser. </p>
  
  <p>Here is the python code:</p>
  
  <pre><code>from selenium import webdriver
  driver = webdriver.Chrome(executable_path='E:\Selenium\WebDrivers\chromedriver.exe')
  </code></pre>
  
  <p>Here is the error message(If disable the proxy in IE "Internet Options", it works fine):</p>
  
  <pre><code>Traceback (most recent call last):
    File "E:\WorkSpace\GitHub\selenium\sandbox\test.py", line 4, in &lt;module&gt;
      driver = webdriver.Chrome(executable_path='E:\Selenium\WebDrivers\chromedriver.exe')
    File "C:\Python27\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 66, in __init__
      self.quit()
    File "C:\Python27\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 81, in quit
      self.service.stop()
    File "C:\Python27\lib\site-packages\selenium\webdriver\chrome\service.py", line 97, in stop
      url_request.urlopen("http://127.0.0.1:%d/shutdown" % self.port)
    File "C:\Python27\lib\urllib2.py", line 126, in urlopen
      return _opener.open(url, data, timeout)
    File "C:\Python27\lib\urllib2.py", line 406, in open
      response = meth(req, response)
    File "C:\Python27\lib\urllib2.py", line 519, in http_response
      'http', request, response, code, msg, hdrs)
    File "C:\Python27\lib\urllib2.py", line 438, in error
      result = self._call_chain(*args)
    File "C:\Python27\lib\urllib2.py", line 378, in _call_chain
      result = func(*args)
    File "C:\Python27\lib\urllib2.py", line 625, in http_error_302
      return self.parent.open(new, timeout=req.timeout)
    File "C:\Python27\lib\urllib2.py", line 406, in open
      response = meth(req, response)
    File "C:\Python27\lib\urllib2.py", line 519, in http_response
      'http', request, response, code, msg, hdrs)
    File "C:\Python27\lib\urllib2.py", line 444, in error
      return self._call_chain(*args)
    File "C:\Python27\lib\urllib2.py", line 378, in _call_chain
      result = func(*args)
    File "C:\Python27\lib\urllib2.py", line 527, in http_error_default
      raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
  urllib2.HTTPError: HTTP Error 401: Unauthorized
  </code></pre>
  
  <p>So, how to set the proxy for the chromedriver? (IE Driver have the same problem).</p>
  
  <p>Thanks Ehsan, but I changed the code, the error still exists.</p>
  
  <pre><code>from selenium import webdriver
  
  chrome_option = webdriver.ChromeOptions()
  chrome_option.add_argument("--proxy-server=10.213.20.62:80" )
  
  driver = webdriver.Chrome(executable_path='E:\Selenium\WebDrivers\chromedriver.exe',
                            chrome_options=chrome_option)
  
  driver.quit()
  </code></pre>
  
  <p>Solved! Just in IE => Internet Options => Connections => LAN Settings, add exception address for NOT use proxy "127.0.0.1", this problem solved! Thanks anyway!</p>