title: Beautiful Soup - Grabbing the string after the first specified tag
body: <p>I'm trying to grab the string immediately after the opening <code>&lt;td&gt;</code> tag.  The following code works:</p>
  
  <pre><code>webpage = urlopen(i).read()
  soup = BeautifulSoup(webpage)
  for elem in soup('td', text=re.compile(".\.doc")):
      print elem.parent
  </code></pre>
  
  <p>when the html looks like this:</p>
  
  <p><code>&lt;td&gt;plan_49913.doc&lt;/td&gt;</code></p>
  
  <p>but not when the html looks like this:</p>
  
  <p><code>&lt;td&gt;plan_49913.doc&lt;br /&gt;
  &lt;font color="#990000"&gt;Document superseded by: &amp;#160;&lt;/font&gt;&lt;a href="/plans/Jan_2012.html"&gt;January 2012&lt;/a&gt;&lt;/td&gt;</code></p>
  
  <p>I've tried playing with attrs but can't get it to work. Basically I just want to grab 'plan_49913.doc' in either instance of html.</p>
  
  <p>Any advice would be greatly appreciated.  </p>
  
  <p>Thank you in advance.</p>
  
  <p>~chrisK</p>