机器人框架:没有id或名称的按钮定位器

2024-09-30 22:23:49 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图让机器人框架点击iframe中的一个按钮。选择带有select frame的iframe后,找不到按钮的定位器。有没有办法找到正确的定位器

按钮HTML:

<button _ngcontent-wwc-c83="" soho-menu-button="" icon="add" menu="add-popupmenu" class="btn-primary btn-icon right-content__add-btn btn-menu has-tooltip hide-focus" _nghost-wwc-c43="" type="button" aria-haspopup="true" aria-controls="add-popupmenu">
   <svg _ngcontent-wwc-c43="" soho-icon="" aria-hidden="true" focusable="false" role="presentation" class="icon">
      <use href="#icon-add"></use>
   </svg>
   <!----><!---->
</button>

Tags: addbutton按钮classmenuiconiframe定位器
1条回答
网友
1楼 · 发布于 2024-09-30 22:23:49

有一个svg标记,您可能需要使用以下xpath:

//*[name()='svg' and @class='icon']

在继续之前,请在HTMLDOM中检查我们是否有唯一的条目

相关问题 更多 >