Get text with BeautifulSoup CSS Selector
<p>Example HTML</p>

<pre><code>&lt;h2 id="name"&gt;
    ABC
    &lt;span class="numbers"&gt;123&lt;/span&gt;
    &lt;span class="lower"&gt;abc&lt;/span&gt;
&lt;/h2&gt;
</code></pre>

<p>I can get the numbers with something like:</p>

<pre><code>soup.select('#name &gt; span.numbers')[0].text
</code></pre>

<p>How do I get the text <code>ABC</code> using BeautifulSoup and the <code>select</code> function? </p>

<p>What about in this case?</p>

<pre><code>&lt;div id="name"&gt;
    &lt;div id="numbers"&gt;123&lt;/div&gt; 
    ABC
&lt;/div&gt;
</code></pre>