How to select all node p until a node div ?
<div>
<div>blbaba</div>
<p>a</p>
<p>b</p>
<p>c</p>
<p>d</p>
<div>blbaba</div>
<p>e</p>
<p>f</p>
<p>g</p>
<p>h</p>
<div>blbaba</div>
</div>
i want a,b,c,d or e,f,g,h i tried something like : //div/following::p[preceding-sibling::div[1]]
Use:
/div/div/following::p[count(preceding::div) = 1]
to get p
after 1stdiv
and before 2nd. Replace 1
in expression with 2
to select p
after 2nddiv
and before 3rd.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With