title: How to switch on pop-up (PDF) by using python selenium
body: <p>I am trying to switch on popup window which has the pdf file by using python selenium package but unable to switch. </p>
  
  <p>I have tried this: </p>
  
  <pre><code>parent_h = browser.current_window_handle
  browser.find_elements_by_xpath(".//i[@class = 'fa fa-certificate']")[i].click()
  browser.find_element_by_xpath(".//object[@data]")
  
  handles = browser.window_handles # before the pop-up window closes
  handles.remove(parent_h)
  
  browser.switch_to_window(handles.pop())
  </code></pre>
  
  <p>link: <a href="https://maharerait.mahaonline.gov.in/searchlist/search?MenuID=1069" rel="nofollow noreferrer">https://maharerait.mahaonline.gov.in/searchlist/search?MenuID=1069</a></p>
  
  <p>Fill the project name 'Hirandani' than click on search and than click on 'View Certificate' icon, will get the popup.</p>