private ListNeed to add HtmlNode.ElementsFlags.Remove("option");GetDropdownList(string HtmlSource, string selectName) { HtmlDocument doc = new HtmlDocument(); HtmlNode.ElementsFlags.Remove("option"); doc.LoadHtml(HtmlSource); return doc.DocumentNode.SelectNodes(string.Format("//select[@name='{0}']//option", selectName)).Select(v => v.Attributes["value"].Value).ToList(); }
before loading html source.
No comments:
Post a Comment