title: Extract all p and a tags from each div with a certain class
body: <p>I have a webpage with the following structure:</p>
  
  <pre><code>&lt;html&gt;
    &lt;body&gt;
      &lt;div class='title'&gt;
        &lt;a&gt;&lt;/a&gt;
        &lt;p&gt;&lt;/p&gt;
      &lt;/div&gt;
      &lt;div class='title'&gt;
        &lt;a&gt;&lt;/a&gt;
        &lt;p&gt;&lt;/p&gt;
      &lt;/div&gt;
      &lt;div class='title'&gt;
        &lt;a&gt;&lt;/a&gt;
        &lt;p&gt;&lt;/p&gt;
      &lt;/div&gt;
      &lt;div class='title'&gt;
        &lt;a&gt;&lt;/a&gt;
        &lt;p&gt;&lt;/p&gt;
      &lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>There's additional content in the page, but for the purposes of this question, it's irrelevant (kind of). </p>
  
  <p>What I'd like to do is extract the <code>&lt;a&gt;</code> and <code>&lt;p&gt;</code> elements from each div with the class <code>title</code>. I've rolled around numerous ways to do this (<code>simple-html-dom</code>, <code>xPath</code>, Regex etc.) but due to my limited knowledge of PHP I'm struggling to understand and a little push in the right direction will probably help me hugely.</p>
  
  <p>So my question is, what would you use? And could you give me an example of how you would use it. It doesn't have to be fool proof, as long as I get the idea then I'll do the rest. </p>
  
  <p>Thanks.</p>