我正在尝试展开+按钮以扩展其下的选项但无法扩展并且python IDE会抛出错误。尝试了不同的CSS和Xpath但没有运气:(
错误讯息:
selenium.common.exceptions.NoSuchElementException:消息:没有这样的元素:无法找到元素:{“method”:“xpath”,
Firefox XPath:
.//* [@ ID = 'ExcentiveTreeViewn0'] / IMG
下面的HTML代码:
<table cellspacing="0" cellpadding="0" style="border-width:0;">
<tbody>
<tr>
<td>
<a id="ExcentiveTreeViewn0" href="javascript:TreeView_PopulateNode(ExcentiveTreeView_Data,0,document.getElementById('ExcentiveTreeViewn0'),document.getElementById('ExcentiveTreeViewt0'),null,'r','<span class=\'nodeCss\' onclick=\"LoadPage(\'grids%252fgrid_folders.aspx%253fid_node%253dTzlq3UXxbAE%253d%2526id_table%253d-301%2526id_mod%253dTzlq3UXxbAE%253d\', \'iGrid\');\"><img class=\'nodeIcon\' src=\"../style/-1/treeview/picto_folder.gif\" /><span class=\'nodeText\'>Rules</span></span>','-300#-301#0#staticNode#0#culture#F','f','','f')">
<img style="border-width:0;" alt="Develop" src="../style/-1/treeview/rplus.gif"/>
</a>
</td>
<td class="" style="white-space:nowrap;" onmouseout="TreeView_UnhoverNode(this)" onmouseover="TreeView_HoverNode(ExcentiveTreeView_Data, this)">
</tr>
</tbody>
</table>
答案 0 :(得分:0)
不要用句号
启动xpath//a[@id='ExcentiveTreeViewn0']/img
其他选择:
请编辑问题以包含您正在尝试的代码以及HTML的更大部分
答案 1 :(得分:0)
问题已解决在路由到正确的IFrame并使用下面链接
中提到的操作类之后