Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Dylan Lopez
Added: Mar 5, 2018 8:24 AM
Modified: Mar 5, 2018 8:25 AM
Views: 16
  1. $tmp = $element->innertext;
  2. $selector1 = 'div[class="active prs last-child"]';
  3. $html1 = str_get_html($tmp);
  4. $ret1 = $html1->find($selector1);
  5. if ($ret1 == FALSE){
  6.     echo "Could not find " . $selector1;
  7. }
  8. else {
  9.     foreach($ret1 as $element1) {
  10.         echo $element1->plaintext;
  11.     }
  12. }