title: BeautifulSoup - combine consecutive tags
body: <p>I have to work with the messiest HTML where individual words are split into separate tags, like in the following example:</p>
  
  <pre><code>&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;span style='font-size:14.0pt;mso-bidi-font-size:11.0pt;line-height:107%;font-family:"Times New Roman",serif;mso-fareast-font-family:"Times New Roman"'&gt;I&lt;/span&gt;&lt;/b&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;span style='font-family:"Times New Roman",serif;mso-fareast-font-family:"Times New Roman"'&gt;NTRODUCTION&lt;/span&gt;&lt;/b&gt;
  </code></pre>
  
  <p>That's kind of hard to read, but basically the word "INTRODUCTION" is split into</p>
  
  <pre><code>&lt;b&gt;&lt;span&gt;I&lt;/span&gt;&lt;/b&gt; 
  </code></pre>
  
  <p>and </p>
  
  <pre><code>&lt;b&gt;&lt;span&gt;NTRODUCTION&lt;/span&gt;&lt;/b&gt;
  </code></pre>
  
  <p>having the same inline properties for both span and b tags.</p>
  
  <p>What's a good way to combine these? I figured I'd loop through to find consecutive b tags like this, but am stuck on how I'd go about merging the consecutive b tags.</p>
  
  <pre><code>for b in soup.findAll('b'):
      try:
         if b.next_sibling.name=='b':
         ## combine them here??
      except:
          pass
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p><strong>EDIT:</strong>
  Expected output is the following</p>
  
  <pre><code>&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;span style='font-family:"Times New Roman",serif;mso-fareast-font-family:"Times New Roman"'&gt;INTRODUCTION&lt;/span&gt;&lt;/b&gt;
  </code></pre>