XPath Query Problem using HTML Agility Pack
See the question and my original answer on StackOverflowIf I run this code:
var web = new HtmlWeb();
var doc = web.Load("http://www.overclockers.co.uk/showproduct.php?prodid=GX-033-HS");
var priceContent = doc.DocumentNode.SelectSingleNode("//*[@id=\"prodprice\"]");
Console.WriteLine("price=" + priceContent.InnerHtml);
It outputs:
price=529.99
So it seems to be working. You can also use //span[@id=\"prodprice\"]"
which is better as it avoids all non SPAN tags.