title: Find <td> that "belongs" to <th> with BeautifulSoup
body: <p>I want to find the value of a <code>&lt;td&gt;</code> that &quot;belongs&quot; to a <code>&lt;th&gt;</code>? I can search for the text in the <code>&lt;th&gt;</code> tag and find it, but I do not know the value and there is no class to search for. The number of columns can vary as well. So all I have is the text in the <code>&lt;th&gt;</code>.</p>
  <p>Example of a table:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;table&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;th colspan=&quot;8&quot;&gt;
                  &lt;span&gt;
                      &lt;a href=&quot;/link&quot;&gt;Table Title&lt;/a&gt;
                  &lt;/span&gt;
              &lt;/th&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;th&gt;Info1&lt;/th&gt;
              &lt;th&gt;Info2&lt;/th&gt;
              &lt;th&gt;Info3&lt;/th&gt;
              &lt;th&gt;Info4&lt;/th&gt;
              &lt;th&gt;Info5&lt;/th&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Value1&lt;/td&gt;
              &lt;td&gt;Value2&lt;/td&gt;
              &lt;td&gt;Value3&lt;/td&gt;
              &lt;td&gt;Value4&lt;/td&gt;
              &lt;td&gt;Value5&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  <p>Let's say I want to find <strong>Value4</strong> which &quot;belongs&quot; to <strong>Info4</strong>, how is this possible in BeautifulSoup?</p>
  <p>Python 3.7.4 and BeautifulSoup 4.9.3.</p>