I'm extracting data from some old HTML files using PHP and the QueryPath library. Extraction is easy when the element I need has a unique css3 ID or class, but this isn't always the case. I have some files containing the following type of data:
<div id="dataDiv">
<div class="1">Heading1</div><div class="2" title="">Data1</div>
<div class="1">Heading2</div><div class="2" title="">Data2</div>
</div>
I would like to use QueryPath to search for a DIV of class "1" containing a certain string of text ("Heading2", for example), and then retrieve any text in the sibling div of class 2 directly next to it. (It would retrieve "Data2" in this case).
Is there built in functionality in QueryPath that allows me to navigate to an element based on the text it contains? If so, once I locate that element, how can I then get the content text of its next sibling element?