标签: xpath
I'd like to select elements of strong. But I want to select the ones not in h3. Does anybody know how to do in xpath? Thanks.
strong
h3
xpath
<h3><sub><strong>abc</strong></sub></h3>
答案 0 :(得分:0)
You’re looking for the ancestor:: axis.
ancestor::
//strong[not(ancestor::h3)]