title: Checking nullable state of spans
body: <p>I've got two elements parsed with jsoup, both the same span:</p>
  
  <pre><code>span.icon-list__title
  </code></pre>
  
  <p>The problem is: The first span is always there, but the second might not be. I tried <code>for</code> loops, doing iterators checking for the first and then the next:</p>
  
  <pre><code>Iterator t = third.select("span.icon-list__title").iterator();
      if (t.hasNext()) {
          title_software = t.next().toString();
          //first behaviour
          while (t.hasNext()) {
              photo_time = t.next().toString();
          }
      }
  </code></pre>
  
  <p>But I always seem to get <code>java.lang.IndexOutOfBoundsException: Invalid index 2, size is 2 error</code>, because the span doesn't seem to exist. Is there any possible way to check if it exists before parsing it?
  The problem is I have two seperate string values.</p>
  
  <p>Basically I've got 3 <code>divs</code> of class <code>icon-list</code>, which can be nullable (do not exist), and each of those divs have two divs:</p>
  
  <p><code>icon-list__title</code> and <code>icon-list__infos</code>, except the third.
  Is there anyway I could check if every item was null or not? I can't seem to be storing the items in proper string variables.</p>
  
  <p>Only the third div has two spans of class <code>icon-list__title</code>.</p>
  
  <p>Here's the HTML:</p>
  
  <pre><code>  &lt;div class="icon-list"&gt;
     &lt;div class="icon-list__icon"&gt;
        &lt;i class="icon-expand"&gt;&lt;/i&gt;
     &lt;/div&gt;
     &lt;div class="icon-list__content"&gt;
        &lt;div class="icon-list__title"&gt;4000 x 2667 pixels&lt;/div&gt;
        &lt;div class="icon-list__infos"&gt;
           &lt;span&gt;3.0 MB&lt;/span&gt;
        &lt;/div&gt;
     &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="icon-list"&gt;
     &lt;div class="icon-list__icon"&gt;
        &lt;i class="icon-camera"&gt;&lt;/i&gt;
     &lt;/div&gt;
     &lt;div class="icon-list__content"&gt;
        &lt;div class="icon-list__title"&gt;
           450
        &lt;/div&gt;
        &lt;div class="icon-list__infos"&gt;
           &lt;span&gt;1&lt;/span&gt;
           &lt;span&gt;2&lt;/span&gt;
           &lt;span&gt;3&lt;/span&gt;
           &lt;span&gt;4&lt;/span&gt;
        &lt;/div&gt;
     &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="icon-list"&gt;
     &lt;div class="icon-list__icon"&gt;
        &lt;i class="icon-info"&gt;&lt;/i&gt;
     &lt;/div&gt;
     &lt;div class="icon-list__content"&gt;
        &lt;span class="icon-list__title"&gt;
        Span span 1
        &lt;/span&gt;
        &lt;span class="icon-list__title"&gt;
        Span span 2
        &lt;/span&gt;
     &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Everything can be nullable.<br/>
  Is it the best if I use a foreach loop and put everything in a recyclerview?</p>