I want to retrieve the alt from an image on a website. In the past, I have done it like this:
@$doc=new DOMDocument();
@$doc->loadHTML($html); //$html is the website
$xml=simplexml_import_dom($doc); // just to make xpath more simple
$images=$xml->xpath('//img');
foreach ($images as $img) {
echo $img['alt'];
}
but now the image I want is within div style="padding: 15px 0px 15px 25px;"
How would I go about retrieving the image? I have tried to change the $xml->xpath() to something else but no luck.
If anyone knows what I need to do, it would be much appreciated.
Thanks!
My mistake, this is actually where the data is contained.
<div class="numbers">
<table cellpadding="3">
<tbody>
<tr>
<tr>
<td>
<img alt="12" src="/images/new/date/date5.gif">
<img alt="39" src="/images/new/date/date4.gif">
<img alt="32" src="/images/new/date/date3..gif">
<img alt="4" src="/images/new/date/date2.gif">
<img alt="20" src="/images/new/date/date1.gif">
</td>
<td>
</tr>
</tbody>
</table>
</div>