How to ignore first element in xpath

后端 未结 2 1937
耶瑟儿~
耶瑟儿~ 2020-12-29 19:53

How can I ignore first element and get rest of the elements?

2条回答
  •  無奈伤痛
    2020-12-29 20:22

    if you want to ignore the "first" element only then:

    //li[position()>1]
    or
    (//a)[position()>1] 
    

    if you want the last only (like your example seems to suggest):

    //li[last()]
    or
    (//a)[last()]
    

提交回复
热议问题