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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -