XPATH - node range selection
I have the following code:
<div id="mydiv">
<h1>Some title</h1>
<p>don't select me</p>
<p>select me 1</p>
<p>select me 2</p>
<p>select me 3</p>
<p>don't select me</p>
</div>
I need to select p [2] through p [4].
Tried this code and it did not work:
'.//*[@id="mydiv"]/p[preceding-sibling::p[4] and following-sibling::p[2]]'
+3
3 answers