On Apr 27, 6:34*pm, SnapDive <SnapD...@community.nospam> wrote:
> I am trying to get a bunch of values into a collection with C# using
> an XPath statement that will let me get all of these HREF/objects:
>
> * * * * * * * * /d.html
> * * * * * * * * /e.html
> * * * * * * * * /f.html
>
> So far I have something like this, but it's not quite working:
> //div[contains(@class,'outerContainer')]/ul/li[contains(@class,'sectionHeader')/@value='GoodLinks'
> I think it's not working because d.html, e.html, f.html are not
> actually "inside" GoodLinks.
>
> This gets me a.html, b.html, c.html:
> //div[contains(@class,'outerContainer')]/ul/li/"
>
> <div class="outerContainer clearFix">
> * * * * <ul>
> * * * * * * * * <li><a href="/a.html"> this is a </a></li>
> * * * * * * * * <li><a href="/b.html"> this is b </a></li>
> * * * * * * * * <li><a href="/c.html"> this is c </a></li>
> * * * * </ul> * * * * * *
> * * * * <ul>
> * * * * * * * * <li class="sectionHeader">GoodLinks</li>
> * * * * * * * * <li><a href="/d.html"> this is d </a></li>
> * * * * * * * * <li><a href="/e.html"> this is d </a></li>
> * * * * * * * * <li><a href="/f.html"> this is d </a></li>
> * * * * </ul> * *
> * * * * <ul>
> * * * * * * * * <li class="sectionHeader">OtherLinks</li>
> * * * * * * * * <li><a href="/g.html"> this is g </a></li>
> * * * * * * * * <li><a href="/h.html"> this is h </a></li>
> * * * * * * * * <li><a href="/i.html"> this is i </a></li>
> * * * * </ul> * *
> </div>
>
> How should the XPath look?
> Thanks.
Take a look at XPather, a firefox plugging. Ideal for what you're
doing.
|