Combine XPATH predicate with position

后端 未结 3 1978
醉梦人生
醉梦人生 2020-12-30 12:55

I have a collection of div elements that have the class media-gallery-item.
I would like to select element number x.

When just selecting all items,

3条回答
  •  生来不讨喜
    2020-12-30 13:35

    Turns out: parenthesis!

    (//div[@id='content-area']//div[@class='media-gallery-item'])[2] 
    

    works

提交回复
热议问题