title: Construct xpath using following-sibling?
body: <p>I have the following html</p>
  
  <pre><code>&lt;table id="registration"&gt;
     &lt;tbody&gt;
        &lt;tr&gt;
           &lt;td class="registration-label"&gt;&lt;span class="size13"&gt;Password&lt;/span&gt;
           &lt;/td&gt;
           &lt;td&gt;
           &lt;/td&gt;
           &lt;td class="form"&gt;
              &lt;input autocomplete="off" class="title wide-input" name="icgdtval" value="" size="50" maxlength="50" type="password"/&gt;
           &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
           &lt;td class="registration-label"&gt;&lt;span class="size13"&gt;Email&lt;/span&gt;&lt;/td&gt;
           &lt;td&gt;&lt;/td&gt;
           &lt;td&gt;&lt;input class="title wide-input" name="hkogplva" value="" maxlength="150" size="26" type="text"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
           &lt;td class="registration-label"&gt;&lt;span class="size13"&gt;Confirm Email&lt;/span&gt;&lt;/td&gt;
           &lt;td&gt;&lt;/td&gt;
           &lt;td&gt;&lt;input class="title wide-input" name="EmailB" value="" size="26" maxlength="150" type="text"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
     &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>The rendered version looks like this</p>
  
  <p><a href="https://i.stack.imgur.com/zTrYa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zTrYa.png" alt="enter image description here"></a></p>
  
  <p>I'm trying to construct a xpath that uses the text before the text box to match the text box. </p>
  
  <p>For example: Construct an xpath that would find the input tag in front of <code>Email</code> by using <code>Email</code> as a reference. I can not find the text box itself as the id or name are dynamically generated.</p>
  
  <p>I have constructed this xpath which works, but I have failed making it work with using the text before the textbox</p>
  
  <pre><code>//tr[td][3]/td[contains(@class,'registration-label')]/following-sibling::td[2]
  </code></pre>