treehouse : what would you like to learn today?
Web Design Web Development iOS Development

extract div container of any website in our site

  • if anyone know how to extract same data container of any div in our own website...from php?? I have dont this

    <?php include('simple_html_dom.php'); $content = file_get_contents_curl("<a href="http://www.gsmarena.com" target="_blank" rel="nofollow">http://www.gsmarena.com"); $html = str_get_html($file_contents); $elem = $html->find('div[id=main]', 0); ?> ?>

    and nothing happened. :(

  • ok i got the solution

    <?php 
      
      include_once('simple_html_dom.php');
      $html = file_get_html("<a href="http://www.gsmarena.com" target="_blank" rel="nofollow">http://www.gsmarena.com");
      $displaybody = $html->find('div[id=brandmenu]', 0);
      echo $displaybody;
      
      ?>
    

    but my question is how to dynamically change the links....i want the php code where our links to the site changes according to gsmarena.com changes its link...