I am using this simple php code to parse some information from html
<?php
/*** a new dom object ***/
$dom = new domDocument;
$dom->loadHTMLFile('https://www.example.com/prehled.php');
/*** load the html into the object ***/
$dom->loadHTML($html);
/*** discard white space ***/
$dom->preserveWhiteSpace = false;
/*** the table by its tag name ***/
$tables = $dom->getElementsByTagName('table');
/*** get all rows from the table ***/
$rows = $tables->item(1)->getElementsByTagName('tr');
/*** loop over the table rows ***/
foreach ($rows as $row) {
/*** get each column by tag name ***/
$cols = $row->getElementsByTagName('td');
echo 'lokalita: '.$cols->item(0)->nodeValue.'<br />';
echo 'celkem: '.$cols->item(1)->nodeValue.'<br />';
echo 'druh: '.$cols->item(2)->nodeValue.'<br />';
echo 'novy: '.$cols->item(3)->nodeValue.'<br />';
echo 'provoz: '.$cols->item(4)->nodeValue;
}
?>
and here is the result: http://pocasi-dnes.cz/test-table.php.
Is there any way how to get simple xml output? Thank you very much for any help.