title: Finding independent tags right next to each other in python scraping
body: <p>I am trying to scrape a Wikipedia page. And facing a simple issue and not able to find the solution. There are 2 tags of th and td next to each other. Also, both of them are independent. I want to get the text of the 1 tag based on the value of the other tag (independent to each other).</p>
  
  <p>Here is an example:</p>
  
  <pre><code>&lt;th scope="row" style="white-space:nowrap;padding-right:0.65em;"&gt;Budget&lt;/th&gt;
  &lt;td style="line-height:1.3em;"&gt;$200 million&lt;sup id="cite_ref-3" class="reference"&gt;&lt;a href="#cite_note-3"&gt;[3]&lt;/a&gt;&lt;/sup&gt;&lt;/td&gt;
  </code></pre>
  
  <p>I want to get the value of 'td' tag (which is $200 million), if the 'th' tag text is 'Budget'. And remember the only correspondence is 'right next to each other'.</p>