Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/328.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何获取当前节点的内容_C#_Xpath_Selenium Webdriver - Fatal编程技术网

C# 如何获取当前节点的内容

C# 如何获取当前节点的内容,c#,xpath,selenium-webdriver,C#,Xpath,Selenium Webdriver,我有一个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 c

我有一个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>
有没有什么有效的方法来获取整个表的内容

  foreach (var player in players)
  {
      var html = player.GetAttribute("innerHTML");  >> only get <tbody> stuff 
  }
foreach(玩家中的var玩家)
{
var html=player.GetAttribute(“innerHTML”);>>仅获取内容
}

获取整个表格内容是什么意思?你能提供预期的结果吗?你应该看看Html敏捷包。这是一个非常有用的工具包,用于解析html并以高效的方式获取所需内容。@sergey:。。。不仅仅是身体tag@steve它们都是xpath的东西,htmlagilitypack也会返回tbody。关于xpath查询有什么建议吗?xpath类似于“//table/node()”。我对它不太熟悉,但应该是这样的
  foreach (var player in players)
  {
      var html = player.GetAttribute("innerHTML");  >> only get <tbody> stuff 
  }