foreach ($page->getElementsByTagName('div') as $div) { if ($div->getAttribute('class') == 'thing-page-image featured') { foreach ($div->getElementsByTagName('img') as $img) { $imgsrc = $img->getAttribute('data-cfsrc'); if (!empty($imgsrc)) { $imgtable[] = $imgsrc; } $imgsrc = $img->getAttribute('data-img'); if (!empty($imgsrc)) { $imgtable[] = $imgsrc; } } } } $imgserialize = serialize($imgtable); $bddpage->setImgsrcs($imgserialize); //nombre de vue foreach ($page->getElementsByTagName('span') as $spans) { if ($spans->getAttribute('class') == 'thing-views') { foreach ($spans->getElementsByTagName('span') as $span) { if ($span->getAttribute('class') == 'interaction-count') { $views[] = $span->textContent; } } } } $bddpage->setViews($views[0]); //nb dl foreach ($page->getElementsByTagName('span') as $spans) { if ($spans->getAttribute('class') == 'thing-downloads') { foreach ($spans->getElementsByTagName('span') as $span) {