I would like to click the cell in the table ID "ContractDesc", "EEE" content:
The HTML page:
<table cellpadding="0" cellspacing="0" border="0" class="tablelist" id="table1" style="width: 80%; margin: 0px 0px 0px 0px;">
<thead>
<tr>
<th style="width: 30%">
AAA
</th>
<th>
BBB
</th>
<th style="width: 40%">
CCC
</th>
</tr>
</thead><tbody>
<tr id="1" onmouseout="fnMouseOut(1)" =="" ""="" onmouseover="fnMouseOver(1)" onclick="selectRow(this)" style="cursor: pointer; background-color: rgb(248, 248, 248);" projectid="111111">
<td align="center" name="contno">
DDD
</td>
<td name="ContractDesc">
EEE
</td>
<td name="">
FFF
</td>
</tr>
</tbody>
</table>
My code that is not working:
driver.find_element_by_xpath('//*[@id="1"]/td[2]').click()
and
driver.find_element_by_name("ContractDesc").click()
The error is:
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="1"]/td[2]"}