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セレクターを使っpreてページ内のすべてのタグを選択するのを手伝ってもらえますか?ただし、それらが別のpreタグ内にない場合に限りますか?(複数のレベルが深い場合でも)
pre
preすべてのタグを選択preして親として持っている場合は壊すのではなく、これをすべて1つのセレクター内で実行できれば素晴らしいと思います。
このような?//pre[not(ancestor::pre)]
//pre[not(ancestor::pre)]
または、完全を期すために、XPath 2.0 で
//pre except //pre//pre