scrape continuous webcontent from more number of page

Discussion in 'Google' started by Nagadurga, Jul 31, 2010.

  1. #1
    Hi,
    Any one give suggestion for me.
    I was tried to extract the web content from the continuous pages. I use the following 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>
    
    PHP:
    But it can be used to retrieve the first page alone from the webpage. When i was tried to retrieve the next next pages from the web page it shows the same information as it in first page. Through analyze the page source i know that all pages are having the same source. How can i rectify it.
    Please leave your valuable solution for me.

    Thanks in advance.
     
    Nagadurga, Jul 31, 2010 IP
  2. Nagadurga

    Nagadurga Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Did u try some other method to do this..
    If yes means please attach your code. May i have some idea whenever i see.
     
    Nagadurga, Jul 31, 2010 IP