Selecting <div> and <p> without duplication

Topics: Developer Forum
Apr 7, 2012 at 4:48 PM
Edited Apr 7, 2012 at 4:49 PM

I want to parse a web page (using HTML Agility Pack) and capture all the text in all div's and p's without duplicating the content.  So I don't want any p's that are contained in div's that I've already captured.

Can anyone give me an example of how I can format the XPath code below to accomplish that?  (Or show me a different approach if that works better)

var AllUniqueDivsandPs = document.DocumentNode.SelectNodes("???");

Thanks!!

bob