title: Obtain title attribute from a tag using BeautifulSoup4
body: <p>Assume the following:</p>
  
  <pre><code>&lt;a href="/wiki/Shanar" title="Shanar"&gt;I WANT THIS TEXT&lt;/a&gt;
  </code></pre>
  
  <p>Now, I've successfully found respectively the table and individual rows using:</p>
  
  <pre><code>table = soup.find('table', class_='sortable')
  table_buy_rows = table.find_all('tr')
  for tr in table_buy_rows:
      td = tr.find('a')
      print(td.text)
  </code></pre>
  
  <p>By printing <code>td</code> I can see I've found the correct rows, but I'm really not sure how to take the text inner <code>a</code> tag.  I've attempted to use <code>print(td.text)</code>, but I'm getting errors doing this, so evidently I'm doing something wrong.</p>
  
  <p>Any suggestions would be much appreciated!</p>