문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top