<table class="questionKeyHeader">
<tbody>
<tr valign="top">
<td>
<a>A0310C</a> = 0<br>
<a>A2300</a> = 05/17/2018<br>
<a>A2400B</a> = 05/12/2018<br>
<a>A2400C</a> = --/--/----<br>
<a>H0200C</a> = Blank/Skipped<br>
<a>H0500</a> = 0<br>
<a>O0100E2</a> = 0<br>
<a>O0100F2</a> = 0<br>
<a>O0100M2</a> = 0<br>
</td>
</tr>
</tbody>
</table>
Above is the HTML this Selenium test is trying to parse. The goal is to find the text that comes after the element. The following xpath will find a given element:
.//following::table[@class="questionKeyHeader"]//td/a[text()="A2300"]
<table class="questionKeyHeader">
<tbody>
<tr valign="top">
<td>
<a>A0310C</a> = 0<br>
<a>A2300</a> = 05/17/2018<br>
<a>A2400B</a> = 05/12/2018<br>
<a>A2400C</a> = --/--/----<br>
<a>H0200C</a> = Blank/Skipped<br>
<a>H0500</a> = 0<br>
<a>O0100E2</a> = 0<br>
<a>O0100F2</a> = 0<br>
<a>O0100M2</a> = 0<br>
</td>
</tr>
</tbody>
</table>
Above is the HTML this Selenium test is trying to parse. The goal is to find the text that comes after the element. The following xpath will find a given element:
.//following::table[@class="questionKeyHeader"]//td/a[text()="A2300"]
But it fails when appending /following-sibling::text() to the end of it. What is the trick to get at the text between the < a > and < br >?