Grow your CSS skills. Land your dream job.

extract div container of any website in our site

  • # March 18, 2013 at 4:23 am

    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(“http://www.gsmarena.com”);

    $html = str_get_html($file_contents);
    $elem = $html->find(‘div[id=main]‘, 0);
    ?>
    ?>

    and nothing happened. :(

    # March 18, 2013 at 5:16 am

    ok i got the solution

    < ?php 

    include_once(‘simple_html_dom.php’);
    $html = file_get_html(“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…

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".