Selenium webdriver using switch_to_windows() and printing the title doesn't print the title.

Here is the code for handle in browser.window_handles: print "Handle = ",handle browser.switch_to_window(handle); elem = browser.find_element_by_tag_name("title") print elem.