Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.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
Vb.net 查找不包含'的元素;我没有任何属性_Vb.net_Xpath_Html Agility Pack - Fatal编程技术网

Vb.net 查找不包含'的元素;我没有任何属性

Vb.net 查找不包含'的元素;我没有任何属性,vb.net,xpath,html-agility-pack,Vb.net,Xpath,Html Agility Pack,我很难找到将返回不具有ID属性的UL列表的语法 以下内容将不返回任何内容 For Each ul As HtmlAgilityPack.HtmlNode In doc.DocumentNode.SelectNodes("//ul[@id='']") 我知道可以使用If语句返回所有的UL,然后返回一个单独的,但是HtmlAgilityPack有没有办法返回没有ID属性的UL列表?/UL[not(@ID)]就可以了 演示(使用): 其中index.html包含: <div> &

我很难找到将返回不具有
ID
属性的
UL
列表的语法

以下内容将不返回任何内容

For Each ul As HtmlAgilityPack.HtmlNode In doc.DocumentNode.SelectNodes("//ul[@id='']")
我知道可以使用If语句返回所有的
UL
,然后返回一个单独的,但是HtmlAgilityPack有没有办法返回没有
ID
属性的
UL
列表?

/UL[not(@ID)]
就可以了

演示(使用):

其中
index.html
包含:

<div>
    <ul>1</ul>
    <ul id="test">2</ul>
    <ul>3</ul>
</div>

    1
    2
      3
<div>
    <ul>1</ul>
    <ul id="test">2</ul>
    <ul>3</ul>
</div>