Find Me On Facebook

Quote

Labels

About me

I am a Computer Programmer. I create software to help people and improve their quality of life. Make software that people can easier to use. Make people much happy and love with the software. I love to learn and work, individually and teams.
I am still fool enough, but I am willing to learn and develop new skills and I am also a very hard worker and happy to undertake any training to achieve career success.

While that does work most of the time, sometimes it gathers additional fields depending on search results, or misses the desired selection entirely. I've been reading about the XPATH Contains function - is there a way for me to restrict the XPath here to just be results where the span ID contains a specific value (like "lblDescription")? I've pored through the manual but cannot seem to figure out how to do this - I tried something like /SPAN[.,contains('Description')] but that doesn't seem to work.

Answer:

You can use XPath matches function. The first parameter is the attribute you want to check. The second parameter is the text you want to test.
In your case, the xpath should be..