Skip to content

Instantly share code, notes, and snippets.

@jeroenbourgois
Created January 23, 2011 13:25
Show Gist options
  • Save jeroenbourgois/792078 to your computer and use it in GitHub Desktop.
Save jeroenbourgois/792078 to your computer and use it in GitHub Desktop.
Parse that html
<?php
$oldSetting = libxml_use_internal_errors( true );
libxml_clear_errors();
$html = new DOMDocument();
$html->loadHtmlFile( 'http://www.makro.be/Content/assortiment/benzinestation/benzineprijzen/1/index.jsp?stat=0' );
$xpath = new DOMXPath( $html );
$nodelist = $xpath->query('//div[@class="boxContent"]/table/tr[last()]/td[last()]');
$nodearr = array();
foreach ($nodelist as $node) {
echo $node->nodeValue;
}
libxml_clear_errors();
libxml_use_internal_errors( $oldSetting );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment