OK, looking to extract data from html pages, I am currently trung DOMX to get elements from the HTML code but I am stuck with this..
EXAMPLE HTML :
Code:
<html>
<body>
<div id="page">
<div id="header">
HEADER ..
</div>
<div id="content">
<div id="item1">
<div class="spacer">
<div class="value">STUFF I WANT</div>
</div>
</div>
<div id="item2">
<div class="spacer">
<div class="value">STUFF I DONT WANT</div>
</div>
</div>
<div id="item3">
<div class="spacer">
<div class="value">STUFF I WANT</div>
</div>
</div>
<div id="item4">
<div class="spacer">
<div class="value">STUFF I WANT</div>
</div>
</div>
</div>
</div>
</body>
</html>
So with DOMX its easy to grab a named DIV content, or even a class, but having multiple divs with the same class name wont help.
I would like to grab somthing like this
Code:
$elements = $xpath->query('//*[contains(@class, \'item1\')]');
but do into the "spacer" div then into the "value" div. So I specify the named parent div then drill into two generic div's for the results I really want.
I havent found a good example of this anywhere yet
Thanks,
Chris