我有一个html源代码如下
<div class="home">
<table class="player" style="top:xx;left:yy"><tbody>...</tbody</table>
<table class="player" style="top:xx;left:yy"><tbody>...</tbody</table>
<table class="player" style="top:xx;left:yy"><tbody>...</tbody</table>
<table class="player" style="top:xx;left:yy"><tbody>...</tbody</table>
</div>
获得球员:
var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(30));
var ele = wait.Until(ExpectedConditions.ElementExists(By.ClassName("home")));
var players = ele.FindElements(By.ClassName("player"));
是否有任何有效的方法来获取整个表格内容
foreach (var player in players)
{
var html = player.GetAttribute("innerHTML"); >> only get <tbody> stuff
}