Question

I know about API's but i'm looking for a more universal solution.

With this Code I get the DIV-Construction of a foreign Website.

 $url = 'http://www.Abc.de';
        $response = file_get_contents($url);
        echo $response; 

but the Javascript doesent fill content. It also doesent works with include. Is there a Possibility to read Data about the Browser? Like an Eye do?

Was it helpful?

Solution

for include you must enable allow_url_include = On in php.ini and if you want to find div in page use HTML DOM

$dom = new DOMDocument;
$dom->loadHTML('url');
foreach ($dom->getElementsByTagName('div') as $div) {
    $divs[]=$div->nodeValue;
}
print_r($divs);

good luck

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top