2

I am trying to find out how to select the ABCD part of the text from below h1 below using xPath on RapidMiner.

 <h1> 2010 ABCD EFGTTH FEEDS ASSGEAA </h1>    

I have come with the following, but it will not return any result at all.

substring-before(substring-after(substring(//h1, 1, 4)/text(), ' '), ' ')

Could someone please give me some suggestion? Thank you.

har07
  • 88,338
  • 12
  • 84
  • 137

1 Answers1

0

This is one possible XPath that work for this specific HTML input :

substring-before(substring-after(normalize-space(//h1), ' '), ' ')

Basically the idea is to remove leading white-spaces first, then get the substring between the first space and the next space.

xpathtester demo link : http://www.xpathtester.com/xpath/24ce7e27ad7030f95032b5b290c57fe0

output : ABCD

har07
  • 88,338
  • 12
  • 84
  • 137