title: C# Selenium XPath data from row that contains a span
body: <p>I am trying to grab data from a table that has two columns. The rows do not have a distinct identifier. But I can search the first column for specifics to find out if I should grab the second column's data.  There are multiple rows in the table although the example below I am just showing one row. </p>
  
  <pre><code>&lt;table id="subtotals-marketplace-table" class="a-normal a-align-bottom a-spacing-none a-size-small"&gt;
  &lt;tbody&gt;&lt;tr class="small-line-height"&gt;
  &lt;td&gt;
      &lt;span&gt;
          Total:
      &lt;/span&gt;
  &lt;/td&gt;
  &lt;td class="a-text-right aok-nowrap a-nowrap"&gt;
      $12.80
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;
  </code></pre>
  
  <p>I need to search for Total: and then grab the dollar amount in the next column.  I've tried multiple iterations of something along these lines but can't seem to find the correct syntax: </p>
  
  <pre><code>driver.FindElement(
                      By.XPath(
                          "//*[@id='subtotals-marketplace-table']//td[contains(text(),'Total:')]/following-sibling::td[1]"))
                      .Text;
  
  driver.FindElement(
                      By.XPath(
                          "//table[@id='subtotals-marketplace-table']//td[contains(text(),'Total:')]/following-sibling::td[1]"))
                      .Text;
  
  driver.FindElement(
                      By.XPath(
                          "//table[@id='subtotals-marketplace-table']/tbody//td[contains(text(),'Total:')]/following-sibling::td[1]"))
                      .Text;
  </code></pre>