HtmlWebNodeVisitor could be smarter about its visitation - the search algorithm specifically doesn't add children to the stack if the current node is at the maximum depth. However, the visitor doesn't have any insight into the depth of the node it's visiting.
Could pass the depth to the visitor as a parameter or augment the Node object with a depth field...
HtmlWebNodeVisitor could be smarter about its visitation - the search algorithm specifically doesn't add children to the stack if the current node is at the maximum depth. However, the visitor doesn't have any insight into the depth of the node it's visiting.
Could pass the depth to the visitor as a parameter or augment the Node object with a depth field...