Using XPATH to search text containing whitespace

后端 未结 2 2041
囚心锁ツ
囚心锁ツ 2021-02-20 11:19

In


  Create Network Container         


        
2条回答
  •  佛祖请我去吃肉
    2021-02-20 11:39

    Try this:

    //td[matches(text(), '\s*Create\s+Network\s+Container\s*')]
    

    To be honest this works for me in several evaluators I checked it in:

     //td[text() = 'Create Network Container']
    

    Previous try was to match all potential space-like characters that might be there (perhaps it's not just a single whitespace there and that's why this simpliest solution doesn't give you proper results.

提交回复
热议问题