示例
driver.get("http://zntx.cc/bbslist-2331.html");
List<WebElement> elements = driver.findElements(By.xpath("/html/body/div[1]/div"));
for (int i = 0; i < elements.size(); i++) {WebElement element = elements.get(i);
// 获取 text 两种效果相同
System.out.println("getText"+element.getText());
System.out.println("innerText"+element.getAttribute("innerText"));
// 获取 html
System.out.println("innerHTML"+element.getAttribute("innerHTML"));
System.out.println(element.findElement(By.xpath("//*[@id=\"main\"]/div[5]/span[1]/a")).getAttribute("innerHTML"));
}