I need to find elements with loan amounts for investor A (in this case it is 100, 100)
can someone suggest how to write xpath to find those elements
[Example] In the screenshot below, I need to find xpath to get elements with text 100 in row one and two for which radio buttons are selected.
Below xpath is giving all the three loan amounts
//td[contains(., "Investor A")]/preceding-sibling::td[descendant::input][1]/label/text()
But I need only loan amounts from row one and two for which radio button is selected
<script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU="
crossorigin="anonymous"></script>
<html>
<head>
<style>
table {
border: 1px dashed #cccccc;
border-collapse: collapse;
}
table td {
border: 1px dashed #cccccc;
}
</style>
</head>
<body>
<table>
<tr>
<td>
<label>Loan1</label>
</td>
<td>
<input type='radio' name='L1' id='L1_one'></input>
<label>100</label>
</td>
<td>
<label>Investor A</label>
</td>
<td>
<input type='radio' name='L1' id='L1_two'></input>
<label>200</label>
</td>
<td>
<label>Investor B</label>
</td>
<td>
<input type='radio' name='L1' id='L1_three'></input>
<label>300</label>
</td>
<td>
<label>Investor C</label>
</td>
</tr>
<tr>
<td>
<label>Loan2</label>
</td>
<td>
<input type='radio' name='L2' id='L2_one'></input>
<label>100</label>
</td>
<td>
<label>Investor A</label>
</td>
<td>
<input type='radio' name='L2' id='L2_two'></input>
<label>200</label>
</td>
<td>
<label>Investor B</label>
</td>
<td>
<input type='radio' name='L2' id='L2_three'></input>
<label>300</label>
</td>
<td>
<label>Investor C</label>
</td>
</tr>
<tr>
<td>
<label>Loan3</label>
</td>
<td>
<input type='radio' name='L3' id='L3_one'></input>
<label>100</label>
</td>
<td>
<label>Investor A</label>
</td>
<td>
<input type='radio' name='L3' id='L3_two'></input>
<label>200</label>
</td>
<td>
<label>Investor B</label>
</td>
<td>
<input type='radio' name='L3' id='L3_three'></input>
<label>300</label>
</td>
<td>
<label>Investor C</label>
</td>
</tr>
</table>
</body>