title: Selenium Python does not close the child window
body: <p>I have webpage which open new browser window on click. I am able to get 2 handles however driver.close() always closes the first/main window.</p>
  
  <pre><code>from selenium import webdriver
  import time
  driver = webdriver.Chrome() 
  driver.get("file:///D:/blackhole/print.html")
  han = driver.window_handles
  print("handles:", han) # gets 1 handle
  time.sleep(2)
  click_btn = driver.find_element_by_link_text('Print')
  click_btn.click()
  han = driver.window_handles
  print("handles:", han) # gets 2 handles
  driver.switch_to_window = han[1] # first element is always first window handle
  driver.close() # main window close
  </code></pre>
  
  <p>Below webpage code which invokes new window</p>
  
  <pre><code>&lt;a href="print.html"  
  onclick="window.open('popprint.html', 
                      'newwindow', 
                      'width=300,height=250'); 
          return false;"
  &gt;Print&lt;/a&gt;
  </code></pre>
  
  <p>Same behaviour for Firefox as well.
  Python 3.6.7</p>