chupacabrot Posted January 23, 2014 Share Posted January 23, 2014 i am trying to extract all the anchor texts that have the _blank attribute but for some reason it won't work as i expected (shows a blank screen) - <?php require('simple_html_dom.php'); libxml_use_internal_errors( true); $url = 'http://www.siteforexample.com/example.html'; $html = file_get_html($url); foreach(($html->find('a[_blank]')) as $clz) echo $clz->innertext . '<br>'; ?> Quote Link to comment Share on other sites More sharing options...
Solution Mace Posted January 23, 2014 Solution Share Posted January 23, 2014 the attribute with the value _blank is target so maybe try a[target=_blank]. The page might also be blank because there is a php error. Try setting your error reporting on E_ALL. Quote Link to comment Share on other sites More sharing options...
chupacabrot Posted January 23, 2014 Author Share Posted January 23, 2014 thanks! that worked perfectly! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.