WebElement body = browser.findElement(By.xpath("//body"));
body.findElement(By.xpath("")); // I want to get all child elements
// inside body, but nothing deeper.
Run Code Online (Sandbox Code Playgroud)
示例文档.
<html>
<body>
<div>
</div>
<span>
<table>
</table>
</span>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
预期的结果是div和span.我无法控制文件,而且差异很大.