Page 1 of 1

InnertTextValue using Xpath

Posted: Fri Apr 12, 2013 11:47 pm
by omayer
How to retrieved "55337" value from innertext using xpath, currently read the innertext as
"Burnsville, MN 55337 United States of America "

//div[#'flashRoot_1']/table/tbody/tr/td[1]/table[1]//table//tr[1]/td[@innertext~'[0-9]']
Thank you in advance

Re: InnertTextValue using Xpath

Posted: Sat Apr 13, 2013 9:25 am
by odklizec
Hi,

You mean you want to retrieve the ZIP code and use it in variable? If you know the number is always 5 digits long, use this reg exp...

Code: Select all

\d{5}
In recording module, it could look like this...
InnerText.png

Re: InnertTextValue using Xpath

Posted: Sat Apr 13, 2013 10:27 am
by omayer
Thank you odklizec, same result using "//table//tr[1]/td[@innertext~'\\d{5}']", Not getting the zipcode

Re: InnertTextValue using Xpath

Posted: Sat Apr 13, 2013 1:52 pm
by odklizec
Not getting where? What exactly you trying to achieve? Could you please share an example project?

I tried the example I gave you and the variable was correctly filled with 5 digits (extracted from your example string).