Robert Valentino Well-Known Member Licensed User Longtime User Sep 11, 2023 #1 I have an html file I am trying to parse that has multiple division lines that are the same Code: <div class="pageSection bowlersSection"></div> I tried to use Code: Dim xRoot As HtmlNode = mHtmlParser.Parse(LeaguePals_Data) Dim BowlerList As List = mHtmlParser.FindDirectNodes(xRoot, "div", mHtmlParser.CreateHtmlAttribute("class", "pageSection bowlersSection")) But always get a empty list and I know that there are at least 3 of this divisions in the file. What is the proper way to use FindDirectNodes for something like this NOTE: if I use FindNode I only get the first occurrence of this division and can't figure out how to get the others Code: Dim BowlerList As HtmlNode = mHtmlParser.FindNode(xRoot, "div", mHtmlParser.CreateHtmlAttribute("class", "pageSection bowlersSection"))
I have an html file I am trying to parse that has multiple division lines that are the same Code: <div class="pageSection bowlersSection"></div> I tried to use Code: Dim xRoot As HtmlNode = mHtmlParser.Parse(LeaguePals_Data) Dim BowlerList As List = mHtmlParser.FindDirectNodes(xRoot, "div", mHtmlParser.CreateHtmlAttribute("class", "pageSection bowlersSection")) But always get a empty list and I know that there are at least 3 of this divisions in the file. What is the proper way to use FindDirectNodes for something like this NOTE: if I use FindNode I only get the first occurrence of this division and can't figure out how to get the others Code: Dim BowlerList As HtmlNode = mHtmlParser.FindNode(xRoot, "div", mHtmlParser.CreateHtmlAttribute("class", "pageSection bowlersSection"))
Robert Valentino Well-Known Member Licensed User Longtime User Sep 11, 2023 #2 Seems I cannot use xRoot to search for the divisions with FindDirectNodes So I searched for the the first division Code: Dim PDFExport As HtmlNode = mHtmlParser.FindNode(xRoot, "div", mHtmlParser.CreateHtmlAttribute("class", "exportTOPDF")) Then I could search for the individual divisions under it Code: Dim BowlerList As List = mHtmlParser.FindDirectNodes(xRoot, "div", mHtmlParser.CreateHtmlAttribute("class", "pageSection bowlersSection")) Upvote 0
Seems I cannot use xRoot to search for the divisions with FindDirectNodes So I searched for the the first division Code: Dim PDFExport As HtmlNode = mHtmlParser.FindNode(xRoot, "div", mHtmlParser.CreateHtmlAttribute("class", "exportTOPDF")) Then I could search for the individual divisions under it Code: Dim BowlerList As List = mHtmlParser.FindDirectNodes(xRoot, "div", mHtmlParser.CreateHtmlAttribute("class", "pageSection bowlersSection"))