gpt4 book ai didi

selenium - href 元素的 Xpath

转载 作者:行者123 更新时间:2023-12-03 15:22:37 25 4
gpt4 key购买 nike

我需要单击下面的 href 元素,它存在于类似的 href 元素中。

<a id="oldcontent" href="listDetails.do?camp=1865"><u>Re-Call</u></a>

任何人都可以为我提供 xpath 以单击上面的 href 链接吗?在此先感谢您的帮助

最佳答案

试试下面的定位器。

selenium.click("css=a[href*='listDetails.do'][id='oldcontent']");

或者
selenium.click("xpath=//a[contains(@href,'listDetails.do') and @id='oldcontent']");

关于selenium - href 元素的 Xpath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13124942/

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