Need generic xpath for the following html code

前端 未结 2 1012
清歌不尽
清歌不尽 2021-01-29 12:00

Following is the HTML code for which I need a unique XPath.

Type
相关标签:
2条回答
  • 2021-01-29 12:33

    @label references to an attribute and not a text node. You want refer to the text content. E. g. you should find the label with this text with fieldset/label[text() = 'White List'].

    0 讨论(0)
  • 2021-01-29 12:45

    You can use index as below to get the expected node if multiple matching nodes are returned.

    (label[text() = 'White List'])[N]
    

    'N' would be the index of node you want to work upon.

    0 讨论(0)
提交回复
热议问题