WebElement body = browser.findElement(By.xpath("//body"));
body.findElement(By.xpath("")); // I want to get all child elements
// inside body, but nothing deeper.
サンプルドキュメント。直ちに子どもを養子にしてください。
<html>
<body>
<div>
</div>
<span>
<table>
</table>
</span>
</body>
</html>
期待される結果はdiv
とspan
です。私は文書を制御することはできず、それらは大きく異なる。
コメントを削除しています... –