| Author |
HtmlUnit - Iterating through DomNodes looking for specific node
|
Ryan Gray
Greenhorn
Joined: Sep 19, 2012
Posts: 1
|
|
Hello all!
I'm using HtmlUnit to get some values from a website. I'm creating an HtmlPage called page, getting page.getDescendants() in an Iterable<DomNode> named pageDesc. Then I iterate through pageDesc and use the if statement to look for the specific node <tr class="away">. The if statement below looks like it should work, but does not. I have an alternative way in comments that DOES work, but I would prefer to access the node using the way not in comments.
Let me know if you need more info or you have an idea to try. Thanks!
|
 |
Steve Luke
Bartender
Joined: Jan 28, 2003
Posts: 3090
|
|
How about you only get the table rows from the page, then iterate over them using getAttribute("class")?
|
Steve
|
 |
 |
|
|
subject: HtmlUnit - Iterating through DomNodes looking for specific node
|
|
|