title: How to get value between two different tags using beautiful soup?
body: <p>I need to extract data present between a ending  tag and a <br> tag in below code snippet:</p>
  
  <pre><code>&lt;td&gt;&lt;b&gt;First Type :&lt;/b&gt;W&lt;br&gt;&lt;b&gt;Second Type :&lt;/b&gt;65&lt;br&gt;&lt;b&gt;Third Type :&lt;/b&gt;3&lt;/td&gt;
  </code></pre>
  
  <p>What I need is : <strong>W, 65, 3</strong></p>
  
  <p>But the problem is that these values can be empty too, like-</p>
  
  <pre><code>&lt;td&gt;&lt;b&gt;First Type :&lt;/b&gt;&lt;br&gt;&lt;b&gt;Second Type :&lt;/b&gt;&lt;br&gt;&lt;b&gt;Third Type :&lt;/b&gt;&lt;/td&gt;
  </code></pre>
  
  <p>I want to get these values if present else an empty string</p>
  
  <p>I tried making use of <strong>nextSibling</strong> and <strong>find_next('br')</strong> but it returned</p>
  
  <pre><code> &lt;br&gt;&lt;b&gt;Second Type :&lt;/b&gt;&lt;br&gt;&lt;b&gt;Third Type :&lt;/b&gt;&lt;/br&gt;&lt;/br&gt;
  </code></pre>
  
  <p><strong>and</strong></p>
  
  <pre><code>&lt;br&gt;&lt;b&gt;Third Type :&lt;/b&gt;&lt;/br&gt;
  </code></pre>
  
  <p>in case if values(W, 65, 3) are not present between the tags</p>
  
  <pre><code>&lt;/b&gt; and &lt;br&gt; 
  </code></pre>
  
  <p>All I need is that it should return a empty string if nothing is present between those tags.</p>