using xpath or css : How to get something which is selected on page using following html code. in following code, Element1 is selected on page and I 开发者_StackOverflow社区wanted to find name of element that is selected on page.
<div id="idc" class="tre">
  <ul id="idCatT_srt_ul" class="abc">
    <li class="treN treB treSelected" title="Element1 title">
      <span class="spclass">Element1</span>
    </li>
  </ul>
</div>
Guessing that you're looking for the <li> that contains selected you can do that with Xpath or CSS selectors like this:
XPath: (if I remember right...)
//*[contains(@class,"selected")]
CSS Selectors:
.treSelected
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论