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.
我有复杂的 xpath 选择器。我想让它通用,所以它可以指向输入和文本区域。
示例 xpath 的
//someelement//input //someelement//textarea
如何将这两个合并到单个 xpath 中?
您可以使用联合:
//someelement//input | //someelement//textarea
或者在 XPath 2 中:
//someelement//(input, textarea)