xpath icon indicating copy to clipboard operation
xpath copied to clipboard

stateful interface is cumbersome when performing multiple xpath queries on one document

Open lolbinarycat opened this issue 2 years ago • 1 comments

as far as i can tell, the only way to do this is to create a new NodeNavigator with htmlquery.CreateXPathNavigator for each query.

additionally, it is cumbersome to turn the result of a query into a string. having to iterate through to find the first result, and then calling Value() seems like a lot, and there is no documentation i could find that suggests this is what you are supposed to do.

lolbinarycat avatar Apr 05 '23 16:04 lolbinarycat

  1. htmlquery depend on the thirdy package golang html, it don't provide a 'Value()' method. one way is wrapper a html.Node to the new class it provides Value() and Attrs() these methods.

zhengchun avatar Apr 06 '23 03:04 zhengchun