I am trying to use Nokogiri to extract the text in-between two unique sets of tags.
What is the best way to get the text within the p-tag in between <h2 class="point">The problem</h2> and <h2 class="point">The solution</h2>, and then all of the HTML between <h2 class="point">The solution</h2> and <div class="frame box sketh">?
Sample of the full html:
<h2 class="point">The problem</h2>
<p>TEXT I WANT </p>
<h2 class="point">The solution</h2>
HTML I WANT with it's own set of tags (but never an <h2> or <div>)
<div class="frame box sketh"><img src="URL for Image I want later" alt="" /></div>
Thank you!
Output:
This XPath selects all following sibling nodes of
h2which is not ah2,divor contains nothing but the string"\n".