title: How to get text (label) of all checkboxes
body: <p>I've been trying to get the label value inside all the checkboxes in a page, so far i have been using this code to automate the HTML below.</p>
  
  <p><strong>JAVA</strong>:</p>
  
  <pre class="lang-java prettyprint-override"><code>List&lt;WebElement&gt; allCBox = driver.findElements(By.xpath("//input[@type='checkbox']"));
  for(WebElement checkbox : allCBox ) {
      System.out.println("--- "+checkbox.gettext()); 
  }    
  </code></pre>
  
  <p><strong>HTML:</strong></p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;html&gt;
    &lt;p&gt; Regions:
      south &lt;input type="checkbox" name="south" value="south"&gt;&amp;nbsp;
      british &lt;input type="checkbox" name="british" value="british"&gt;&amp;nbsp;
      north &lt;input type="checkbox" name="north" value="north"&gt;&amp;nbsp;
      southeast &lt;input type="checkbox" name="southeast" value="southeast"&gt;&amp;nbsp;
      west &lt;input type="checkbox" name="west" value="west"&gt;&amp;nbsp;
      Spanish &lt;input type="checkbox" name="spanish" value="spanish"&gt;&amp;nbsp;
      europian &lt;input type="checkbox" name="europian" value="europian"&gt;&amp;nbsp;
      northeast &lt;input type="checkbox" name="northeast" value="northeast"&gt;
    &lt;/p&gt;
  &lt;/html&gt;
  </code></pre>