我想从网站获取数据。我正在使用HtmlAgilityPack(C#)。在网站内容是这样的在HtmlAgilityPack,Xpath中使用谓词
<div id="list">
<div class="list1">
<a href="example1.com" class="href1" >A1</a>
<a href="example4.com" class="href2" />
</div>
<div class="list2">
<a href="example2.com" class="href1" >A2</a>
<a href="example5.com" class="href2" />
</div>
<div class="list3">
<a href="example3.com" class="href1" >A3</a>
<a href="example6.com" class="href2" />
</div>
<div class="list3">
<a href="example4.com" class="href1" >A4</a>
<a href="example6.com" class="href2" />
</div>
<div class="list3">
<a href="example5.com" class="href1" >A5</a>
<a href="example6.com" class="href2" />
</div><div class="list3">
<a href="example6.com" class="href1" >A6</a>
<a href="example6.com" class="href2" />
</div><div class="list3">
<a href="example3.com" class="href1" >A7</a>
<a href="example6.com" class="href2" />
</div>
</div>
在这里,我们有7类链接class =“href1”。我只想抓取3个链接(从第3个链接到第5个链接)。如何获取这些特定的链接?
非常感谢你.. – 2012-02-16 20:25:24