I'm parsing the html page, and I'm new to this kind of parsing, could you suggest me the idea to parse following html
HTML Code : http://notepad.cc/share/CFRURbrk3r
for each type of room, there are list of sub rooms so I wish to group them as Parent - Childs into the List of Objects. then later we can access to each of those childs.
this is the code as far as I could do but without adding to the Objects, besides Fizzler is there any other parser I can do in this case.
var uricontent = File.ReadAllText("TestHtml/Bew.html");
var html = new HtmlDocument(); // with HTML Agility pack
html.LoadHtml(uricontent);
var doc = html.DocumentNode;
var rooms = (from r in doc.QuerySelectorAll(".rates")
from s in r.QuerySelectorAll(".rooms")
from rd in r.QuerySelectorAll(".rate")
select new
{
Name = rd.QuerySelector(".rate-description").InnerText.CleanInnerText(),
Price = r.QuerySelector(".rate-price").InnerText.CleanInnerText(),
RoomType = s.QuerySelector("tr td h2").InnerText.CleanInnerText()
}).ToArray();