1: on the news page of the website there are headlines links.
2: go inside that links and fetch the html of that page.
3: with simple dom only fetch the article image.
4: output all the images.
but i am stuck in the 2nd part.
here is the code:
Code: Select all
<?php
require('simple_html_dom.php');
$url = 'http://www.goal.com/en/news/archive/1/';
$site_url = 'http://www.goal.com/';
$html = file_get_html($url);
$links = array();
// List Title Links of on the page...........
// --------------------------------------------
foreach($html->find('.imgBox') as $tl) {
$url_inner = $tl->find('a', 0)->href;
// Inside of the Title Links
// --------------------------------------------
$innerpage = file_get_contents($site_url . $url_inner);
$html_innerpage = file_get_html($innerpage);
echo $html_innerpage;
}
?>