selenium get element by xpath code example
Example 1: driver.find_element_by_xpath
driver.find_element_by_xpath('//*[@id="emailField"]')
Example 2: get element by xpath
document.evaluate('XPATH HERE', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
Example 3: relative xpath sample
//input[@id=’user-message‘]
Example 4: selenium ways of finding
elementcss= driver.findElement(By.cssSelector('div.nav-search-input'))