Scraping non-absolute URL

Posted by cooldude on Stack Overflow See other posts from Stack Overflow or by cooldude
Published on 2011-01-04T20:02:16Z Indexed on 2011/01/04 21:54 UTC
Read the original article Hit count: 177

Filed under:
|

I am trying to scrape www.weather.bm. I want all 10 radar images, but I can only get one (the image updates regularly) and it's not a absolute image url. I was hoping I could use the image as a image slideshow like the link but dont know how. Also, how can I remove images/Radarlegend.png? I just need the radar images.

Here is my code:

include('simple_html_dom.php');
$html = file_get_html('http://www.weather.bm/radarMobile.asp');
foreach($html->find('img') as $element) 
echo $element->src . '<br>'

My output is:

<div id="main">
images/Radar/CurrentRadarAnimation_100km_sri/100km_sri-radar-2011-01-04-1556.jpg<br>images/Radarlegend.png<br></div>
</div>

© Stack Overflow or respective owner

Related posts about php

Related posts about html