title: Get Element by ClassName with DOMdocument() Method
body: <p>Here is what I am trying to achieve : retrieve all products on a page and put them into an array. Here is the code I am using :</p>
  
  <pre><code>$page2 = curl_exec($ch);
  $doc = new DOMDocument();
  @$doc-&gt;loadHTML($page2);
  $nodes = $doc-&gt;getElementsByTagName('title');
  $noders = $doc-&gt;getElementsByClassName('productImage');
  $title = $nodes-&gt;item(0)-&gt;nodeValue;
  $product = $noders-&gt;item(0)-&gt;imageObject.src;
  </code></pre>
  
  <p>It works for the <code>$title but</code> not for the product. For info, in the HTML code the img tag looks like this : </p>
  
  <pre><code>&lt;img alt="" class="productImage" data-altimages="" src="xxxx"&gt;
  </code></pre>
  
  <p>I have been looking at this (<a href="https://stackoverflow.com/questions/10526069/php-domdocument-how-to-get-element">PHP DOMDocument how to get element?</a>) but I still don't understand how to make it work.</p>
  
  <p>PS : I get this error :</p>
  
  <blockquote>
    <p>Call to undefined method <code>DOMDocument::getElementsByclassName()</code></p>
  </blockquote>