gpt4 book ai didi

css - 我如何获得 xpath 或其他定位器?

转载 作者:太空宇宙 更新时间:2023-11-04 01:43:25 25 4
gpt4 key购买 nike

我需要帮助来获得最好的元素定位器,我可以使用以下代码将其用于按钮;

<button onclick="btnProcess($(this), 'Adding...','fa-refresh fa-spin',0);callServer('/DejavuMobile/action/UserGroupModel_AddItem/Users/Add?hfUsername=8_44&amp;ic=44&amp;hfService=', function(response){ btnProcess($(this), 'Add new item','fa-plus',1);loadContent($('#UserAddUI') ,response); });" class="btn btn-xs btn-labeled btn-info" type="button" style="padding-right:12px;padding-left:12px;margin-left:15px;margin-bottom:15px;"><span class="btn-label"><i class="fa fa-plus"></i></span>Add new Group</button>

最佳答案

最易读的:

//button[text()='Add new Group']

可以使用类或任何其他属性创建路径,但在这种情况下通过文本是最清晰和简单的方法。

关于css - 我如何获得 xpath 或其他定位器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44972703/

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