Is it possible to scrape XPATH non-greedy-ly? I mean for example I have this HTML:
<div>
<p>A</p>
<p>B</p>
<h2>Only until this node</h2>
<p>I should not get this</p>
<h2>Even though this node exists</h2>
</div>
I want an XPATH which only gets the paragraphs with A and B inside. The text inside the nearest h2
node is always changing, so I need non-greedy XPATH if it is possible. Is it possible? And how?