title: Efficient way to extract text from between tags
body: <p>Suppose I have something like this:</p>
  
  <pre><code>var = '&lt;li&gt; &lt;a href="/...html"&gt;Energy&lt;/a&gt;
        &lt;ul&gt;
        &lt;li&gt; &lt;a href="/...html"&gt;Coal&lt;/a&gt; &lt;/li&gt;
        &lt;li&gt; &lt;a href="/...html"&gt;Oil &lt;/a&gt; &lt;/li&gt;
        &lt;li&gt; &lt;a href="/...html"&gt;Carbon&lt;/a&gt; &lt;/li&gt;
        &lt;li&gt; &lt;a href="/...html"&gt;Oxygen&lt;/a&gt; &lt;/li'
  </code></pre>
  
  <p>What is the best (most efficient) way to extract the text in between the tags? Should I use regex for this? My current technique relies on splitting the string on <code>li</code> tags and using a <code>for</code> loop, just wondering if there was a faster way to do this.</p>