title: Beautiful Soup distinguish text with or without tag
body: <pre><code>html1=
  ...
  &lt;span class=&quot;ruby&quot;&gt;&lt;span class=&quot;rb&quot;&gt;textrb1 &lt;/span&gt;&lt;span class=&quot;rt&quot;&gt;textrt1 &lt;/span&gt;&lt;/span&gt;text1 &lt;span class=&quot;ruby&quot;&gt;&lt;span class=&quot;rb&quot;&gt;textrb2 &lt;/span&gt;&lt;span class=&quot;rt&quot;&gt;textrt2 &lt;/span&gt;&lt;/span&gt;text2
  ...
  </code></pre>
  <p>In the end, I want to print something like: <code>textrb1 (textrt1) text1 textrb2 (textrt2) text2</code>, text in the bracket.
  If I print <code>html1.text</code>, I get all the text without bracket: <code>textrb1 textrt1 text1 textrb2 textrt2 text2</code>
  I can access to textrb1 by <code>html1.find('span',class='rt')</code>.
  I want to know how to access to the 'normal' text text1 and text2 in the right order like</p>
  <pre class="lang-py prettyprint-override"><code>for text in volltext:
    if text is textrt:
      texts.append('('+text+')')
    else:
      texts.append(text)
  </code></pre>