preceding in selenium seearch for top of the page code example Example: contains text xpath //*[contains(text(),'ABC')]