title: How to find tag with particular text with Beautiful Soup?
body: <p>How to find <code>text I am looking for</code> in the following HTML (line breaks marked with <code>\n</code>)?</p>
  <pre class="lang-html prettyprint-override"><code>...
  &lt;tr&gt;
    &lt;td class=&quot;pos&quot;&gt;\n
        &quot;Some text:&quot;\n
        &lt;br&gt;\n
        &lt;strong&gt;some value&lt;/strong&gt;\n
    &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td class=&quot;pos&quot;&gt;\n
        &quot;Fixed text:&quot;\n
        &lt;br&gt;\n
        &lt;strong&gt;text I am looking for&lt;/strong&gt;\n
    &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td class=&quot;pos&quot;&gt;\n
        &quot;Some other text:&quot;\n
        &lt;br&gt;\n
        &lt;strong&gt;some other value&lt;/strong&gt;\n
    &lt;/td&gt;
  &lt;/tr&gt;
  ...
  </code></pre>
  <p>The code below returns first found value, so I need to filter by <code>&quot;Fixed text:&quot;</code> somehow.</p>
  <pre><code>result = soup.find('td', {'class' :'pos'}).find('strong').text
  </code></pre>
  <p>UPDATE: If I use the following code:</p>
  <pre><code>title = soup.find('td', text = re.compile(ur'Fixed text:(.*)', re.DOTALL), attrs = {'class': 'pos'})
  self.response.out.write(str(title.string).decode('utf8'))
  </code></pre>
  <p>then it returns just <code>Fixed text:</code>, not the <code>&lt;strong&gt;</code>-highlighted text in that same element.</p>