TestProject Forum

How do i substring this value?


`<span class="select2" id="select2" role="textbox" aria-readonly="true" 
<div class="DK "><strong>XYXY - SAF</strong><br>123456789 - PRODUCTTest <br>766 MYUTZZYXC FGTUG, CALIFORNIA 92673-6304</div></span>`

I m looking to extract 12456789 alone from this string

While recording am not able to replace the xpath , which is valid in the chrome console

for example :

//*[@id=“select2”]/div/text()[1] would return the value ,but its not allowing to use this xpath

Hi @Hari,
You can use the get text action on the div element to get all the text inside


Then use the action split string using regex with the previous result parameter
and the regex should be \n and the index should be 1 Like this

Please let me know if you managed to implement this .