title: Extract content from url and website
body: <p>I get content from website using <code>file_get_contents()</code>.</p>
  
  <p>When I get this content I can see all the content and tags of the website.</p>
  
  <p>I need to extract the content from some of the tags, not all of them. I think the best it´s get the content and save it into a database or a text file for future manipulation.</p>
  
  <p>For example if I get this with php <code>file_get_contents()</code>:</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;&lt;script src="script.js"&gt;&lt;/head&gt;
  
      &lt;body&gt;
          &lt;div id="header"&gt;&lt;/div&gt;
  
          &lt;div class="item"&gt;&lt;/div&gt;
          &lt;div class="item"&gt;&lt;/div&gt;
  
          &lt;div id="image"&gt;&lt;/div&gt;
  
          &lt;div class="item"&gt;&lt;/div&gt;
          &lt;div class="item"&gt;&lt;/div&gt;
  
          &lt;div id="footer"&gt;&lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>How can I get for example only the content of divs with the class <code>item</code>? Is it possible to use jQuery or do I need to use php? I have tried many things but I need a guide or someone to tell me how I can extract what I need</p>
  
  <p>Thanks, Regards </p>