title: Extracting data from an HTML code
body: <p>I have this piece of HTML code as a string stored in a variable.</p>
  
  <pre><code>&lt;p style="text-align: center;"&gt;
      &lt;span style="font-size: small;font-family: comic sans ms', sans-serif;"&gt;
          &lt;strong&gt;
              word1&amp;nbsp;
              &lt;span style="line-height: 1.5;"&gt;
                  word2&amp;nbsp;
              &lt;/span&gt;
              &lt;span style="line-height: 1.5;"&gt;
                  word3&amp;nbsp;
              &lt;/span&gt;
              &lt;span style="line-height:1.5;"&gt;&lt;/span&gt;
          &lt;/strong&gt;
      &lt;/span&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>I want only to extract <code>word1&amp;nbsp;</code>, <code>word2&amp;nbsp;</code> and <code>word3&amp;nbsp;</code>. How can I do it in an easiest and time efficient way?</p>
  
  <p>I was thinking the character <code>&gt;</code> that was not preceded immediately by <code>&lt;</code> can be a index where I can start extracting my data. </p>