Probably a BUG

Mar 6, 2009 at 5:09 AM
Hi,

HtmlAgilityPack can't extract texts on OPTION element.
Mar 10, 2009 at 5:01 AM
post sample code buddy
Mar 10, 2009 at 5:23 AM
Heh. It's just a simple expression anyway "//select/option"

HtmlDocument htmldoc = new HtmlDocument()
HtmlNodeCollection nodeColl;

htmldoc.LoadHtml("<html codes here>");
nodeColl = htmldoc.DocumentElement.SelectNodes("//select/option");

if(nodeColl!=null) {
foreach(HtmlNode thisNode in nodeColl) {
Console.WriteLine(thisNode.InnerText);
}
}

I wonder why other's can't replicate/simulate this simple error
Sep 1, 2009 at 9:23 PM

The text of Option nodes can be found in NextSibling.Innertext

(Not sure if this is a standard way to model the structure though)