php - How get content in block which we get from remote url (parsing)? -
good day.
i use code:
$file = file_get_contents('http://www.whois.com/whois/testtest.com');
full code page whice $file can see here
tell me please how content in block <div class="whois_result" id="registrydata">....</div>
?
regardless of you scrape remote page (hint: @ curl), need sort of dom parser parse response.
libxml_use_internal_errors(true); //prevents warnings, remove if desired $dom = new domdocument(); $dom->loadhtml($file); $node = $dom->getelementbyid("registrydata"); $output = $dom->savehtml($node); echo $output;
Comments
Post a Comment