I'm using the PHP QueryPath library to extract data from a collection of old HTML files, and for the most part have been using the CSS selectors available through the find() function to extract data. However, not all of the elements containing data I need to extract have a unique CSS identifier, so I've been using an ugly combination of Regexp and QueryPath to extract the data.
<ul class="list><li>Data1</li><li>Data2</li></ul>
How would I, for example, cleanly extract "Data2" from this list element? Is there a QueryPath function that will let me specify, for example, the second child of a parent element as the element to retrieve?
To get the nth matched object you can use QueryPath::get(n-1)
.