<HEAD> <TITLE><?php msg('PRD_VIEW_PAGE_TITLE'); ?> </TITLE> <?php include 'part_htmlheader.php'; ?> </HEAD> <BODY> <TABLE cellspacing="0" cellpadding="0" align="center" border="0" width="670"> <TR> <TD> <?php ProductInfo(); ?> </TD> </TR> <TFOOT> <TR height=100> <TH><?php // // Insert Page Footer // include 'part_footer_popup.php'; ?> </TH> </TR> </TFOOT> </TABLE>
$uri = $tds[1]->find('a'); #print_r($uri); $record = array('Name' => $matches[0], 'URI' => 'http://ark.intel.com' . $uri[0]->href); $output[] = $record; } return $output; } $motherboards = GetList($dom); //print_r($motherboards); function ProductInfo($motherboards) { foreach ($motherboards as $mobo) { $html = scraperWiki::scrape($mobo['URI']); $dom = new simple_html_dom(); $dom->load($html); $specs = $dom->find('div#specifications', 0); $details = array(); $details['Name'] = $mobo['Name']; foreach ($specs->find('tbody tr') as $row) { $tds = $row->find('td'); if (count($tds) == 2) { $details[$tds[0]->plaintext] = $tds[1]->plaintext; } } scraperwiki::save_sqlite(array('Name'), $details); $output[] = $details; } return $output; } $info = ProductInfo($motherboards);