extrait de la classe nom de la balise beautifulsoup python

J'ai le code HTML suivant:

    <td class="image">
      <a href="/target/tt0111161/" title="Target Text 1">
       <img alt="target img" height="74" src="img src url" title="image title" width="54"/>
      </a>
     </td>
     <td class="title">
      <span class="wlb_wrapper" data-caller-name="search" data-size="small" data-tconst="tt0111161">
      </span>
      <a href="/target/tt0111161/">
       Other Text
      </a>
      <span class="year_type">
       (2013)
      </span>

Je suis en train d'utiliser belle soupe pour analyser certains éléments dans un fichier délimité par des tabulations.
J'ai eu de une grande aide et disposent de:

for td in soup.select('td.title'):
 span = td.select('span.wlb_wrapper')
 if span:
     print span[0].get('data-tconst') # To get `tt0082971`

Maintenant, je veux recevoir un "Texte Cible 1" .

J'ai essayé certaines choses comme le texte ci-dessus tels que:

for td in soup.select('td.image'): #trying to select the <td class="image"> tag
img = td.select('a.title') #from inside td I now try to look inside the a tag that also has the word title
if img:
    print img[2].get('title') #if it finds anything, then I want to return the text in class 'title'
Avez-vous fait une tentative à l'extraction de vous-même?
J'ai édité le post ci-dessus
un autre thread ici: stackoverflow.com/questions/41369344/...

OriginalL'auteur kegewe | 2014-02-06