Here is the code
for handle in browser.window_handles:
print \"Handle = \",handle
browser.switch_to_window(handle);
elem = browser.find_element_
driver.switch_to_window(driver.window_handles[-1])
title=driver.title
You can do it simply use the code above. driver.window_handles[-1] would get the lastest window.
The title of the page wouldn't be in a value
attribute of a title
element, it would be the text contents of that element.
The correct way to access that text would be browser.find_element_by_tag_name("title").text
Or even easier, just access browser.title
.