Hi,
I was tried to retrieve the web content from the "
http://www.local.ch/en/q/bar.
html" link. I use the following code
Code:
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<table>
<tr>
<td>
<center><h3> Bar Name </h3></center>
<?php
$html = file_get_contents ('http://tel.local.ch/en/q/bar.html?typeref=res');
$dom = new DomDocument();
@$dom->loadHTML ($html);
$xpath = new DOMXPath ($dom);
$key1 = $xpath->query ('//*[@class="fn"]');
foreach($key1 as $keys){
echo $keys->nodeValue ,"<br/> \n";
}
?>
</td>
<td>
<center><h3> Address </h3></center>
<?php
$html = file_get_contents ('http://tel.local.ch/en/q/bar.html?typeref=res');
$dom = new DomDocument();
@$dom->loadHTML ($html);
$xpath = new DOMXPath ($dom);
$key2 = $xpath->query ('//*[@class="adr"]');
foreach($key2 as $keys){
echo $keys->nodeValue ,"<br/> \n";
}
?>
</td>
<td>
<center><h3> Conduct </h3></center>
<?php
$html = file_get_contents ('http://tel.local.ch/en/q/bar.html?typeref=res');
$dom = new DomDocument();
@$dom->loadHTML ($html);
$xpath = new DOMXPath ($dom);
$key3 = $xpath->query ('//*[@class="phonenr"]');
foreach($key3 as $keys){
echo $keys->nodeValue ,"<br/> \n";
}
?>
</td>
</tr>
</table>
</html>
But it can only used to retrieve the first page information. I am in need of extract the content from continuous page. I was tried to extract the second page from the web page. But it gives information which is available in first page. through analyzing the web page source i know that all pages having same sources. how can i rectify it. Please give your valuable suggestion.
Thanks in advance.