It should return: ShouldHit as verified with w3cSchool online tool.
Instead it throws NullPointerException:
Exception in thread "main" java.lang.NullPointerException
at us.codecraft.xsoup.xevaluator.CombiningEvaluator$And.matches(CombiningEvaluator.java:53)
at us.codecraft.xsoup.xevaluator.CombiningEvaluator$And.matches(CombiningEvaluator.java:53)
at us.codecraft.xsoup.xevaluator.StructuralEvaluator$ImmediateParent.matches(StructuralEvaluator.java:84)
at us.codecraft.xsoup.xevaluator.CombiningEvaluator$And.matches(CombiningEvaluator.java:53)
at us.codecraft.xsoup.xevaluator.StructuralEvaluator$ImmediateParent.matches(StructuralEvaluator.java:84)
at us.codecraft.xsoup.xevaluator.CombiningEvaluator$And.matches(CombiningEvaluator.java:53)
at org.jsoup.select.Collector$Accumulator.head(Collector.java:42)
at org.jsoup.select.NodeTraversor.traverse(NodeTraversor.java:31)
at org.jsoup.select.Collector.collect(Collector.java:24)
at us.codecraft.xsoup.xevaluator.DefaultXPathEvaluator.evaluate(DefaultXPathEvaluator.java:29)
Example xml snippet:
XPath:
//table/tbody/tr[contains(td,'whatever']/td/span/text()
It should return: ShouldHit as verified with w3cSchool online tool. Instead it throws NullPointerException: