我试图单击下面的三个按钮中的任何一个,但是找不到名称,ID或类别来标识
有任何提示吗?
<user-tile-actions ng-transclude="actions"> <!----><button ng-if="!vm.user.isBlockingMe
&& !vm.user.isBlocked" type="button" class="button-height-32 button-padding-10 follow-icon
button-scs button-scs-shadow" user-follow="vm.user" event-label="user-tile-small"><i class="icon-
person-plus"></i></button><!----> </user-tile-actions>
<button ng-if="!vm.user.isBlockingMe && !vm.user.isBlocked" type="button" class="button-
height-32 button-padding-10 follow-icon button-scs button-scs-shadow" user-follow="vm.user" event-
label="user-tile-small"><i class="icon-person-plus"></i></button>
<i class="icon-person-plus"></i>
我收到消息:否这样的元素:无法找到元素:消息: {“方法”:“ css选择器”,“选择器”:“。button-height-32 button-padding-10 follow-icon button-scs button-scs-shadow”}
答案 0 :(得分:1)
您尝试过
driver.find_element_by_xpath("//button[@event-label='user-tile-small']").click()
答案 1 :(得分:1)
如果它不在iframe或其他任何东西中,这也应该起作用。
driver.find_element_by_class_name("button-scs-shadow").click()