0

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

KunduK
  • 32,888
  • 5
  • 17
  • 41
user8618585
  • 81
  • 1
  • 10

2 Answers2

0

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

Martin Honnen
  • 160,499
  • 6
  • 90
  • 110
0

To looking into html which you have posted there is no : text inside <h3>...</h3> tag. Try the below code.

//h3[. = 'Webpages']/following-sibling::ul[@class='list-entity-locations']/li/a/text()
KunduK
  • 32,888
  • 5
  • 17
  • 41