title: How can I get all div elements with jsoup?
body: <p>I am learning how to use jsoup. I first thought jsoup was like jquery but it is not.</p>
  
  <p>I want to extract this html body to elements of divs.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;&lt;/head&gt;
      &lt;body&gt;
              &lt;div&gt;
                  &lt;h1&gt;Title&lt;/h1&gt;
              &lt;/div&gt;
              &lt;div&gt;
                  &lt;img src="/xx.jpg" /&gt;
              &lt;/div&gt;
              &lt;div&gt;
                  &lt;p&gt;Paragraph 1&lt;/p&gt;
                  &lt;p&gt;Paragraph 2&lt;/p&gt;
              &lt;/div&gt;
              &lt;div&gt;
                  &lt;h2&gt;&lt;b&gt;End&lt;/b&gt;&lt;/h2&gt;
              &lt;/div&gt;
          &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I am using this code:</p>
  
  <pre><code>Document doc = Jsoup.parse(htmlString);
  Elements divs = doc.select("div");
  </code></pre>
  
  <p>but it returns all of the divs. I want elements to return like this :</p>
  
  <pre><code>divs.get(0).toString(); // "&lt;h1&gt;Title&lt;/h1&gt;"
  divs.get(1).toString(); // "&lt;img src="/xx.jpg" /&gt;"
  divs.get(2).toString(); // "&lt;p&gt;Paragraph 1&lt;/p&gt;&lt;p&gt;Paragraph 2&lt;/p&gt;"
  divs.get(3).toString(); // "&lt;h2&gt;&lt;b&gt;End&lt;/b&gt;&lt;/h2&gt;"
  </code></pre>
  
  <p>Please assist me in getting divs to elements with jsoup and return as above?</p>