C# HTML agility pack QuerySelector返回null

C# HTML agility pack QuerySelector返回null,c#,html-agility-pack,fizzler,C#,Html Agility Pack,Fizzler,我正在使用Fizzler作为Html敏捷包。这是我在firebug中测试jquery时使用的选择器: $('table.adsh>tbody:nth-child(1)>tr:nth-child(4) table tr:nth-child(1)>td:nth-child(2)') 但这行代码在C代码中返回null: 项始终为空。我的选择器有什么问题吗 提前感谢您的帮助。我解决了这个问题。我打印了page.QuerySelector(“table.adsh”).InnerHtml

我正在使用
Fizzler
作为
Html敏捷包
。这是我在firebug中测试jquery时使用的选择器:

$('table.adsh>tbody:nth-child(1)>tr:nth-child(4) table tr:nth-child(1)>td:nth-child(2)')
但这行代码在C代码中返回null:

项始终为空。我的选择器有什么问题吗


提前感谢您的帮助。

我解决了这个问题。我打印了
page.QuerySelector(“table.adsh”).InnerHtml
并看到它不包括任何
t车身
标记。但是当我在Chrome或FireFox中检查元素时,该表包含
tbody
标记。原因是原始Html代码不包括
tbody
,当我
Inspect元素
表格时,浏览器会将
tbody
添加到已检查的代码中。在页面源代码中,我可以看到原始html

请在此处阅读更多:

因此,我刚刚从选择器中删除了
tbody

var item = page.QuerySelector("table.adsh>tbody:nth-child(1)>tr:nth-child(4) table tr:nth-child(1)>td:nth-child(2)");