I am trying to get the selected element for a particular webpage, but I have trouble doing this.
Even my code is I. I am trying to get the selected element in a web page, which has the name "postal list", and no code of mine is working.
I also tried htmlweb.DocumentNode.SelectNodes ("// select")
Fixed zero main (string [] args) {HtmlNode.ElementsFlags.Remove (" the option "); HTML Web HTMLweb = New HtmlWeb (); HtmlDocument HTML = htmlweb.Load ("https://www.ura.gov.sg/realEstateWeb/realEstate/pageflow/transaction/submitSearch.do"); // HtmlNode bodyNode = html.DocumentNode.SelectNodes ("// select"); HtmlNode bodyNode = html.DocumentNode.SelectSingleNode ("/ html / body"); HtmlNode selectNode = html.GetElementbyId ("postalDistrictList"); Select HtmlNodeCollection nodes = html.DocumentNode.SelectNodes (select "// [[name name = 'postalDistrictList']); // HtmlNode selectNode = html.DocumentNode.SelectSingleNode (" // selection [@ name = 'Post distinction list '] "); HtmlNode node = selectionnode; // foreach (HtmlNode node in the selection node) {Console.Out.Write (node property [" option "]. Value); Console.Out.WriteLine ();}} < Try the XPath // // select [@ name = 'poststrictDistrictList'], / code>
HtmlNodeCollection nodes = html.DocumentNode.SelectNodes (select "//. [[Name name = 'postalDistrictList']); You should help you find the collection of elements you seek.
Comments
Post a Comment