1
我使用HtmlAgilityPack来解析html页面。我想选择一个标签h3的集合,然后遍历它,并且对于每个h3元素,我想选择它旁边的一个元素。这里是我的示例HTML:选择当前元素旁边的元素HtmlAgilityPack
<h3>Somthing here</h3>
<ul>list of something</ul>
<h3>Somthing here</h3>
<ul>list of something</ul>
<h3>Somthing here</h3>
<ul>list of something</ul>
<h3>Somthing here</h3>
<ul>list of something</ul>
<h3>Somthing here</h3>
<ul>list of something</ul>
我知道如何选择H3的集合,但我没有任何想法如何选择UL旁边的每个
你的意思是:h3Node.selectSingleNode(“following-sibling :: ul [1]”)? –