WebElement body = browser.findElement(By.xpath(\"//body\"));
body.findElement(By.xpath(\"\")); // I want to get all child elements
// i
/html/body/*
Will select only immediate children elements of body
.
Do remember that if you copy all these selected nodes, you also copy their content. So, if you do copy-of
, table
will also be produced to the resulting document.
Also, I would recommend to read at least XPath basics, you ask too many similar questions.