I am currently working on extracting data from html. I would like to extract the text between two tags.
<p class="xfHeading"><b>XYZ:</b></p>
<p>asdfghjk</p>
<p>sdsdsd</p>
<p>asdvcvcfghjk</p>
<p class="xfHeading"><b>ABC:</b></p>
<P>fvgbhnjm</P>
<p class="xfHeading"><b>PQR:</b></p>
<ul>
</ul>
<p class="xfHeading"><b>MNO:</b></p>
<ul>
<li>jdjshdj</li>
</ul>
The output should be :
asdfghjk
sdsdsd
asdvcvcfghjk
One way to do this is :
/p[class="xfHeading"]/following-sibling::p[0]|/p[class="xfHeading"]/following-sibling::p[1]|/p[class="xfHeading"]/following-sibling::p[2]
or
/p[class="xfHeading"]/following-sibling::p[position()<4]
However since the content between keeps on changing all the time I need a solution wherein the content between the two tags is extracted.