Currently I'm trying to use xpath to parse an html page from a website.
I need to get a result in the format:
Time of the program : Program name
For example:
1.00PM : Ye Hai Mohabbatein
I am using the following code (as shown here) to obtain it but it is not working.
<?php
libxml_use_internal_errors(true);
$dom = new DomDocument;
$dom->loadHTMLFile("www.starplus.in/schedule.aspx");
$xpath = new DomXPath($dom);
$nodes = $xpath->query("//table");
foreach ($nodes as $i => $node) {
echo "hy";
echo "Node($i): ", $node->nodeValue, "\n";
}
?>
I will be thankful if anybody help me out in this issue.