Hi Guys,
Slowly but surely i’m getting my head around loading html into a domDocument to parse out parts i’m looking for.
currently i have:
<?php
// parse the html into a DOMDocument
$dom = new DOMDocument();
$dom->loadHTML($html);
$xpath = new DOMXPath($dom);
$results = $xpath->query("/html/body/div[3]/center/table/tbody/tr/td/table/tbody/tr/td[2]/div[2]/table/tbody/tr/td");
foreach ($results as $result) {
}
?>
i got the xPath location by using xpather for firefox, the piece of html i’m trying to loop over and get values from is:
<acronym title="Affiliate Info: Pays % on Level1 Seller Accepts PAYPAL "><table width="95%" border="0" align="center" cellpadding="0" cellspacing="3"><tr align="left"><td colspan="2" class="acat" >TITLE I NEED PARSED<font color="#567faf"> $39.95</font></td>
</tr><tr align="left"><td width="26"> </td>
<td class="subtitle_s"><em><font color="#333333"><span>DESCRIPTION I NEED TO PARSE</></font></em></td>
</tr><tr align="left"><td> </td>
<td><a href=a.page.php?id=9911&u=pydtcm >Promote</a> | <a href=http://site.com/r/9911/XXXXX/ target=_blank>Visit site</a><acronym> | [ APS: <span onClick="window.open('aps.php','','width=500, height=300');" style="color:#0000FF;
text-decoration:underline; cursor:pointer;">547.32</span>* ]</acronym></td>
is there any way i can print to screen the domDocument once loaded?
i’m not usually this slow with learning lol
thanks guys
Graham