title: Find index of tag with certain text in beautifulsoup/python
body: <p>I have a simple 4x2 html table that contains information about a property. </p>
  
  <p>I'm trying to extract the value <code>1972</code>, which is under the column heading of <code>Year Built</code>. If I find all the tags <code>td</code>, how do I extract the index of the tag that contains the text <code>Year Built</code>? </p>
  
  <p>Because once I find that index, I can just add <code>4</code> to get to the tag that contains the value <code>1972</code>.</p>
  
  <p>Here is the html:</p>
  
  <pre><code>&lt;table&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Building&lt;/td&gt;
              &lt;td&gt;Type&lt;/td&gt;
              &lt;td&gt;Year Built&lt;/td&gt;
              &lt;td&gt;Sq. Ft.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;R01&lt;/td&gt;
              &lt;td&gt;DWELL&lt;/td&gt;
              &lt;td&gt;1972&lt;/td&gt;
              &lt;td&gt;1166&lt;/td&gt;
          &lt;/tr&gt;   
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>For example I know that if my input is index <code>2</code> and my output is text of that tag <code>Year Built</code>, I can just do this:</p>
  
  <pre><code>from bs4 import BeautifulSoup
  soup = BeautifulSoup(myhtml)
  td_list = soup.find_all('td')
  print td_list[2].text
  </code></pre>
  
  <p>But how do I use input of text <code>Year Built</code> to get output of index <code>2</code>?</p>