title: HttpUnit - how to use getTextBlocks
body: <p>I would like to know how I can access all texts in a web page using http unit.
  The problem I have is that <code>getTextBlocks</code> only seems to return texts in <code>h1</code> .. <code>h6</code> tags. I would like to find the text "Support LS" that is contained in the below HTML fragment. Excuse my short question, but googling for <code>httpunit getTextBlocks</code> doesn't return many useful matches. I wonder whether I have to descend the text blocks recursively, since each text block seems to have a <code>getTextBlocks</code> - method.</p>
  
  <pre><code>    TextBlock[] texts;
      try {
          texts = actualResponse.getTextBlocks();
      } catch (SAXException e) {
          e.printStackTrace();
          return e.toString();
      }
  
      errorMessage = "Did not find needle " + webService.getWebServiceNeedle();
      for(int i = 0; i&lt;texts.length; ++i) {
          TextBlock tb = texts[i];
          if(debugMode) {
              logger.debug("Web Check " + webService.getWebServiceName() + " Text =" + tb.getText());
          }
          if(tb.getText().indexOf(webService.getWebServiceNeedle()) &gt;= 0) {
              logger.info("Found needle" + webService.getWebServiceNeedle());
              errorMessage = null;
              break;
          }
      }
  
  &lt;!-- &lt;body&gt; --&gt;
  &lt;header class="clsHead"&gt;
              &lt;div&gt;
                  &lt;a href="#wrapper" id="menu-toggle" class="glyphicons glyphicons-show-lines clsMenuMain"&gt;&lt;/a&gt;
              &lt;/div&gt;
              &lt;div&gt;
                  &lt;span class="clsHeadFont"&gt; 2.0 &lt;/span&gt;   
              &lt;/div&gt;   
                 &lt;div&gt;
                      &lt;marquee id="flashMessage" style="position: absolute;bottom: 18px;left:240px;" class="span8" scrollamount="4"&gt;&lt;/marquee&gt; 
                    &lt;/div&gt;  
               &lt;div class="CLSuserloginadmin"&gt;
              &lt;!--  &lt;span &gt;&lt;div style="float:right"&gt;
  
              &lt;/div&gt;&lt;/span&gt; --&gt;
  
          &lt;span class="clsHeadFont1"&gt;Welcome, Support LS&lt;/span&gt; &lt;span
              class="clsHeadFont1 clsHeadLogPad"&gt; | &lt;/span&gt; &lt;a href="logout"&gt;Logout &lt;/a&gt;
  
              &lt;a class="dropdown-toggle" data-toggle="dropdown"&gt;&lt;img
              class=""
              src="/rator-monitoring/resources/img/setting.png"
              id="lodindb"
              style="width: 28px; margin-top: -5px; padding-left: 11px;"&gt;&lt;/a&gt;
  
              &lt;ul class="dropdown-menu" role="menu"&gt;
                  &lt;li class="version"&gt;About&lt;/li&gt;
                  &lt;li class="preferences"&gt;User Preferences&lt;/li&gt;                                             
              &lt;/ul&gt;
  
  
      &lt;/div&gt;
  
  
  
   &lt;/header&gt;
  </code></pre>