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]]
Best Answer
Use:
to get
p
after 1stdiv
and before 2nd. Replace1
in expression with2
to selectp
after 2nddiv
and before 3rd.