How to get the preceding element?

前端 未结 3 981
有刺的猬
有刺的猬 2020-12-14 07:21

Pages : 1 ,

3条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-14 07:48

    I know this is old and if you didn't know the containing element preceding the "Name." element this wouldn't be a solution for you. BUT, if you were wanting to find exactly that element and there are several "171" elements all over the page. The way to distinguish it from the rest, you could use the following.

    //p[b[contains(., 'Next.')]]//a[contains(., '171')]
    

提交回复
热议问题