title: Get image source from html dom element
body: <p>I am querying image using <code>getElementsByTagName("img")</code> and printing it using <code>image-&gt;src</code> , it does not work. I also tried to use <code>image-&gt;nodeValue</code> this to does not work.</p>
  
  <pre><code>require('simple_html_dom.php');
  
  $dom=new DOMDocument();
  $dom-&gt;loadHTML( $str);       /*$str contains html output */
  
  $xpath=new DOMXPath($dom); 
  $imgfind=$dom-&gt;getElementsByTagName('img');  /*finding elements by tag name img*/
  
  foreach($imgfind as $im)
  {
      echo $im-&gt;src;        /*this doesnt work  */   
      /*echo $im-&gt;nodeValue;  and also this doesnt work (i tried both of them             separately ,Neither of them worked)*/
  
      // echo "&lt;img src=".$im-&gt;nodeValue."&lt;/img&gt;&lt;br&gt;"; //This also did not work
  }
  
  /*the image is encolsed within div tags.so i tried to query value of div and print but still image was not printed*/
  
  $printimage=$xpath-&gt;query('//div[@class="abc"]'); 
  foreach($printimage as $image)
  {
      echo $image-&gt;src;   //still i could not accomplish my task
  }
  </code></pre>