This project has moved and is read-only. For the latest updates, please go here.

Xpath in htmlagilitypack

Aug 17, 2011 at 8:00 AM

I use "copy XPath" on firebug to get xpath from website. I have used TidyManaged to check and fix as :


using (Document document = Document.FromString(Response))           

	document.ShowWarnings = true;  
        Response = document.Save();           

HtmlNode.ElementsFlags["html"] = HtmlElementFlag.Empty |HtmlElementFlag.Closed|HtmlElementFlag.CanOverlap;            

HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();            


HtmlNode node = doc.DocumentNode.SelectSingleNode("/html/body/div[@id='wrapper']/form/table[@class='rSet']//tr[2]/td/div[@class='pCenter']");

I have remove "tbody" tags from xpath string. But node still return null. Any ideas to my problems ? I need to copy firebug's xpath. Thank in advance for helping. :(