I try to get from all div.traffic_entry
elements the following data img->src
, img->alt
and .traffic_detail
. In this test i try to get bäck only the .traffic_detail
but i get back 1,5MB of Data.
$html = new simple_html_dom();
//test data, real data are http://www.radio-siegen.de/service/verkehr/
$html->load('
<html>
<body>
<div class="traffic_entry ">
<img class="traffic_img" src="/images/gfx/verkehr/A45.gif" alt="A45 Gießen Richtung Hagen" />
<div class="traffic_detail">
<b>A45 Gießen Richtung Hagen</b><br>
Einfahrt Wetzlar-Ost Bauarbeiten, Einfahrt gesperrt, eine Umleitung ist eingerichtet, bis 28.08.2018 15:30 Uhr
</div>
</body>
</html>
');
foreach($html->find('.traffic_detail') as $test){
var_dump($test);
}
I use the version 1.5 ($Rev: 196 $)
.
In the end my array should look like.
array(
array('img' => '/images/gfx/verkehr/A45.gif',
'heading' =>'A45 Gießen Richtung Hagen',
'text' => '<b>A45 Gießen Richtung Hagen</b><br>
Einfahrt Wetzlar-Ost Bauarbeiten, Einfahrt gesperrt, eine Umleitung ist eingerichtet, bis 28.08.2018 15:30 Uhr'
),
array('img' => '/images/gfx/verkehr/A4.gif',
'heading' =>'A45 Olpe Richtung Köln',
'text' => '<b>Agjsdkhklndsl</b><br>
klsfdnjknfklnsdjkr'
)
)