gpt4 book ai didi

java - 如何在selenium中单击img src - java

转载 作者:行者123 更新时间:2023-12-02 01:49:07 26 4
gpt4 key购买 nike

<a href="/index.php/leave/assignLeave" target="_self" xpath="1">
<img src="/webres_5acde3dbd3adc6.90334155/orangehrmLeavePlugin/images/ApplyLeave.png" style="">
</a>

我收到错误:

"no such element: Unable to locate element: {"method":"css
selector","selector":"a[src='webres_5acde3dbd3adc6.90334155/orangehrmLeavePlugin/images/ApplyLeave.png']"}"

最佳答案

你应该尝试<img>标签而不是 <a>因为src<img> 的属性

CSS

img[src='/webres_5acde3dbd3adc6.90334155/orangehrmLeavePlugin/images/ApplyLeave.png']

关于java - 如何在selenium中单击img src - java,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53256128/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com