<?php
include('simple_html_dom.php');
// Create DOM from URL or file
$html = file_get_html('http://mypage.com/page.html');
foreach($html->find('table.result') as $article) {
$item['image'] = $article->find('img[class=thumbnail]',0)->src;
$item['title'] = $article->find('strong',0)->plaintext;
$item['details'] = $article->find('div[style=margin-top:5px]',0)->plaintext;
$item['price'] = $article->find('td[id=price]',0)->plaintext;
$item['timestamp'] = $article->find('td[width=13%]',0)->plaintext;
$item['link'] = $article->find('a',0)->href;
$articles[] = $item;
}
// and some code here? to make it grab $item['link'] result link and follow it.. then
// also parse some contents.. and probably called $item['image2'] $item['image3']
//$item['image4'] etc.. so it can all be done in one swoop for db insertion??
// would seem tricky as theres 15 FOREACH runs in the main page
//and each has a link.. so it would be parcing the main page then 15 othe rlink
//pages.. on the for each loop.. POSSIBLE?
print_r($articles);
?>
and some code here? to make it grab $item['link'] result link and follow it.. then
also parse some contents.. and probably called $item['image2'] $item['image3']
$item['image4'] etc.. so it can all be done in one swoop for db insertion??
would seem tricky as theres 15 FOREACH runs in a page
and each has a link.. so it would be parcing the main page then 15 othe rlink
pages.. on the for each loop.. POSSIBLE?