For Each div As HtmlNode In doc.DocumentNode.SelectNodes("//div[contains(@class, 'Box1')]")
For Each table As HtmlNode In div.SelectNodes("table[contains(@class, 'full Table')]")
I get passed the first For Each to look for the table, but I get an error on For Each table as HtmlNode In div.SelectNodes...
For Each div As HtmlNode In doc.DocumentNode.SelectNodes("/div[contains(@class, 'Box1')]")
For Each table As HtmlNode In div.SelectNodes("/table[contains(@class, 'full Table')]")
JAYHAWKER
Participant
1252 Points
1896 Posts
What am I doing wrong with the following code in trying to find the table node?
Jun 30, 2012 11:54 AM|LINK
The html code I am trying to screen scrape is:
<div id="box_3" class="Box1"> <div id="box_3Top" class="Box1 th"> Information </div> <div class="cb"> </div> <table class="full Table"> <tr class="nob"> <td class="bold bordb bluef"> Name</td> </tr> </table> </div>Code trying to scan table with class full Table.
For Each div As HtmlNode In doc.DocumentNode.SelectNodes("//div[contains(@class, 'Box1')]") For Each table As HtmlNode In div.SelectNodes("table[contains(@class, 'full Table')]")I get passed the first For Each to look for the table, but I get an error on For Each table as HtmlNode In div.SelectNodes...
it says that object doesn't exist.
What am I doing wrong?
Rajaji.K
Member
506 Points
78 Posts
Re: What am I doing wrong with the following code in trying to find the table node?
Jun 30, 2012 12:55 PM|LINK
For Each table As HtmlNode In div.SelectNodes("//table[contains(@class, 'full Table')]")JAYHAWKER
Participant
1252 Points
1896 Posts
Re: What am I doing wrong with the following code in trying to find the table node?
Jun 30, 2012 02:17 PM|LINK
I still get the same error, "Object reference not set to an instance of an object"
JAYHAWKER
Participant
1252 Points
1896 Posts
Re: What am I doing wrong with the following code in trying to find the table node?
Jun 30, 2012 02:30 PM|LINK
I got it...the Url wasn't exactly correct!
Rajaji.K
Member
506 Points
78 Posts
Re: What am I doing wrong with the following code in trying to find the table node?
Jun 30, 2012 02:56 PM|LINK
For Each div As HtmlNode In doc.DocumentNode.SelectNodes("/div[contains(@class, 'Box1')]") For Each table As HtmlNode In div.SelectNodes("/table[contains(@class, 'full Table')]")