title: How to fix OSError: [WinError 6] The handle is invalid with Python and Selenium?
body: <p>I'm trying to log into my Fidelity account, using Selenium, and Fidelity.  I've made sure that I'm using the correct webdriver (version 78 for my Chrome version 78).  I think this has to do with the only Chrome webdriver is 32-bit and I'm using 64-bit.  This is the last error I'm getting.  It opens the webpage, put my user name and password, and then I think on the button click it crashes or right before it.</p>
  
  <pre class="lang-py prettyprint-override"><code>from selenium import webdriver
  
  
  def test_bot(username, password):
      chrome_options = webdriver.ChromeOptions()
      chrome_options.add_experimental_option("excludeSwitches", ['enable-automation'])
      br = webdriver.Chrome(chrome_options=chrome_options)
      br.get("https://www.fidelity.com")
      br.implicitly_wait(10)
  
      user = br.find_element_by_id('userId-input')
      user.clear()
      user.send_keys(username)
  
      pwd = br.find_element_by_id('password')
      pwd.clear()
      pwd.send_keys(password)
  
      btn = br.find_element_by_id('fs-login-button')
      btn.click()
  
  
  test_bot("MYUSERNAME", "MYPASSWORD")
  </code></pre>
  
  <p>Here's the error I'm getting. </p>
  
  <pre><code>Exception ignored in: &lt;function Popen.__del__ at 0x03957270&gt;
  Traceback (most recent call last):
    File "C:\Users\Notebook\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 860, in __del__
      self._internal_poll(_deadstate=_maxsize)
    File "C:\Users\Notebook\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 1216, in _internal_poll
      if _WaitForSingleObject(self._handle, 0) == _WAIT_OBJECT_0:
  OSError: [WinError 6] The handle is invalid
  </code></pre>
  
  <p>I'm using Pycharm and Selenium.</p>