xpath text() function code example Example 1: contains text xpath //*[contains(text(),'ABC')] Example 2: html xpath name //input[@name='username']