D
D
Denis99992015-12-25 20:51:56
Python
Denis9999, 2015-12-25 20:51:56

How to print the value of a repr element in Python 3?

How to display the value of the repr element if a different element value is generated?

<selenium.webdriver.remote.webelement.WebElement (session="20e86134-70bd-48fc-93
fb-dea581db1ce9", element="{7620c0da-7136-4247-b017-070b938d2eee}")>

The code:
t = driver.find_element_by_xpath(".//*[@id='header']/div/nav/ul/li[5]/a")
print(t)
repr(t)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
throughtheether, 2015-12-25
@Denis9999

I didn't quite understand the question. Do you need link text? Try

t = driver.find_element_by_xpath(".//*[@id='header']/div/nav/ul/li[5]/a")
print (t.text)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question