xpathjdom-2

IllegalArgument Exception : Unable to compile


I am getting IlleagalArgument Exception while retreiving Xpath for a particular node

I need to retrieve the below webpage link which follows the title WebPages ,I tried using the below expression but it is not able compile (Please see the comment section for the html )

page.getNode("//h3[. = 'Webpages:']/following-sibling::/ul[@class='list-entity-locations']/li/a/text()")

This is what I tried but got Exception

java.lang.IllegalArgumentException: Unable to compile


Solution

  • The right syntax is following-sibling::ul, not following-sibling::/ul.