Xpath Get elements that are between 2 elements

前端 未结 2 749
无人及你
无人及你 2020-12-10 20:47

can anyone tell me if its possible to select only the divs 2a and 2b from this html fragment? the problem is that the divs are not children of h4 element and so the xpath qu

相关标签:
2条回答
  • 2020-12-10 21:20
    div[preceding-sibling::h4='Two' and following-sibling::h4='Three']
    
    0 讨论(0)
  • 2020-12-10 21:27
    div[preceding-sibling::h4[1] = 'Two']
    
    0 讨论(0)
提交回复
热议问题