Selection Techniques - Partial Text Filter or RegEx Filter

Posted by Agung Pambudi in , ,
Hi,

How can I add a Text Filter that matches a partial text or a pattern?

For example, if I wanted to capture the dimensions of a TV.

How could I create a text filter for an element that matches "TV (WxHxD)" or "TV without stand (WxHxD)"?
How could I create a text filter that contains a partial text like "TV" for a string "TV (WxHxD)"?
Could I run a RegEx to the Text Filter?
Check out the attached project

Templates: LG TVs\TVs\specs_tab\DIMENSIONS/WEIGHT
Element: Dimensions


Solution:



You can use xpath function - contains:

//DIV[contains(UL[1]/LI[1], 'TV')]/UL[2]/LI[1]

F.Y.I:

The w3cschools will give you more details and plenty of examples.
www.w3schools.com/XPath/xpath_syntax.asp


No comments:

Post a Comment