html - how to remotely check a website? -
i build free widget customers want them put website link on websites want check regularly websites html code site link , if remove link stop widget automatically. want know thinking correctly? mean, possible check websites' code remotely? if possible how start? thought getting html of page using php method file_get_content , parse returned file not because did not find way parse returned string.
$html = htmlentities(file_get_contents('http://example.com/')); echo $html;
i use dom :
<?php $doc = new domdocument(); $doc->loadhtml('http://example.com'); $exm = $doc->getelementsbytagname('a'); print_r($exm); //will print domnodelist object ( ) ?>
i not want use "regexp" not reliable of time if there ideas or tips provided thankful
use dom dig in page content: http://php.net/dom
Comments
Post a Comment