Tomas Nemeth
Tomas Nemeth

Reputation: 95

Python webdriver current window handle print to readable form

from selenium import webdriver
#
driver = webdriver.Firefox()
#
url = driver.get('http://www.google.com')
#
handles = driver.current_window_handle
print(handles)

output:

{fc6891c1-e4a9-434b-9f76-fc09bc252e71}

Anybody knows how how to get text of that window handle??

Many thanks in advance for your answer.

Upvotes: 1

Views: 1969

Answers (1)

Mahsum Akbas
Mahsum Akbas

Reputation: 1583

print driver.find_element_by_tag_name("body").text

Upvotes: 1

Related Questions