Select nodes after specific node

Topics: User Forum
Dec 14, 2009 at 8:47 AM
Edited Dec 14, 2009 at 10:38 AM

Hello guys.

I have this html structure:

 

<body>
<p class="paragraph">text</p>
<p class="paragraph">text</p>

<p class="specific">text</p>
<p class="paragraph">text</p>
<p class="paragraph">text</p>
</body>

And I need to get all the <p> with class "paragraph" that exist after the <p> with class "specific".

Is there a way to do that? 

Thanks.

 

Update : I posted the issue on stackoverflow and I got a solution http://stackoverflow.com/questions/1899789/html-agility-pack-select-nodes-after-specific-node

 

Dec 15, 2009 at 3:32 AM

"//p[@class='specific']/following::p[@class='paragraph']"

Dec 15, 2009 at 10:34 PM
booolean wrote:

"//p[@class='specific']/following::p[@class='paragraph']"

That's the best solution right there. Good stuff booolean.