Can't find string after a tag with BeautifulSoup in Python?
<p>In this HTML I want to get the string of it but no matter what I try it doesn't work (string = none)</p>

<pre><code>      &lt;a href="/analyze/default/index/49398962/1/34925733" target="_blank"&gt;
       &lt;img alt="" class="ajax-tooltip shadow radius lazy" data-id="acctInfo:34925733_1" data-original="/upload/profileIconId/default.jpg" src="/images/common/transbg.png"/&gt;
       Jue VioIe Grace
      &lt;/a&gt;
</code></pre>

<p>There's a few of these on the page and I tried this:</p>

<pre><code>print([a.string for a in soup.findAll('td', class_='tou')])
</code></pre>

<p>The output is just none.</p>

<p>EDIT: here is the entire page HTML, hope this helps, just to clarify, I need to find all instances like the one above and extract their string</p>

<p><a href="http://pastebin.com/4mvcMsJu" rel="nofollow">http://pastebin.com/4mvcMsJu</a></p>

<pre><code>&gt;&gt;&gt; from bs4 import BeautifulSoup
&gt;&gt;&gt; soup = BeautifulSoup(open('input.html'), 'lxml')
&gt;&gt;&gt; [tag.text.strip() for tag in soup]
[u'Jue VioIe Grace']
</code></pre>

<p>If we want to restrict the search to text in <em>anchor</em> tags:</p>

<pre><code>&gt;&gt;&gt; [tag.text.strip() for tag in soup.findAll('a')]
[u'Jue VioIe Grace']
</code></pre>

<p>Note that there are no <code>td</code> tags in your sample input and no tag has the attribute <code>class_='tou'</code>.</p>

python beautifulsoup