Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
<div> <input type="checkbox" data-bind="checked: isSelected"> Select this box </input> </div>
嗨,我正在尝试使用 xpath 中的内部文本选择复选框,但到目前为止还没有运气。例如,我知道以下内容不起作用: //input[contains(text(), 'Select this box')]
请对正确的语法有任何建议吗?注意,它需要包含内文。
谢谢
您的代码有效(使用 XpathpatherizerNPP 测试):
//input[contains(text(),"Select this box")]