You're iterating over all
Member 1753250 wrote:
Dim rows As HtmlAgilityPack.HtmlNodeCollection = main.DocumentNode.SelectNodes("th")
<th> nodes which are direct descendants of the document. There probably aren't any.
Instead, based on the comments, you probably want to iterate over the
<tr> nodes which are direct descendants of the
Dim rows As HtmlAgilityPack.HtmlNodeCollection = tables(0).SelectNodes("tr") However, this will depend on the markup. The rows might not be direct descendants of the
<table>; they could be nested in one or more
When you query for cells, you're also only looking for
<th> elements. You're skipping ordinary
If you don't have to worry about nested tables, you could try:
Dim rows As HtmlAgilityPack.HtmlNodeCollection = main.DocumentNode.SelectNodes("//table[@id='workorders']//tr")
For i As Integer = 0 To rows.Count - 1
Dim cols As HtmlAgilityPack.HtmlNodeCollection = rows(i).SelectNodes("th|td")
"These people looked deep within my soul and assigned me a number based on the order in which I joined."