I'm using Xpath to select an element based on it's text from a web page, which works as long as the text selector doen't contain spaces.
When the selector does contain spaces, however, it fails.
I have looked at: Locating the node by value containing whitespaces using XPath
and xpath expression to remove whitespace
and how to get the normalize-space() xpath function to work?
but that did not work.
A sample of the html that fails:
<tr style="vertical-align:top;">
<td style="height:15px;"></td>
<td class="cs9D60B82">Yellow Fees</td>
<td class="cs9D60B82">Group1</td>
<td class="cs9D60B82">Yes</td>
<td class="cs9DB0B82"></td>
<td class="cs9D60B82">QD 1,234.56</td>
</tr>
These work, but could return other nodes starting the same text too:
"//td[starts-with( normalize-space(), 'Yellow')]"
"//td[starts-with(text(), 'Yellow')]"
These don't work:
"//td[normalize-space(.) = 'Yellow Fees']"
"//td[translate(text(), '	

','') = 'YellowFees']"
"//td[translate(text(), ' 	

','') = 'Yellow Fees']"
"//td[translate(text(), ' ','') = 'YellowFees']"
"//td[translate(text(), '	

','') = 'Yellow Fees']"
"//td[matches( text(), 'Yellow Fees')]"