-3

I want to get the attribute's content with this xPath command

"//*[@id="navbarleft"]/div[1]/ul[3]/li[2]/@class"

but it seems like it return the object attribute @class rather than it's content:

enter image description here

HedgeHog
  • 22,146
  • 4
  • 14
  • 36
  • 1
    Does this answer your question? [How to get attribute of element from Selenium?](https://stackoverflow.com/questions/30324760/how-to-get-attribute-of-element-from-selenium) – JaSON Feb 18 '21 at 13:48

1 Answers1

0

Use string function. add your xpath in string function

string(//*[@id='navbarleft']/div[1]/ul[3]/li[2]/@class)
Amol Patil
  • 23
  • 5