“driver.find_element_by_xpath” Respostas de código

Driver Encontre elemento por XPath

from selenium.webdriver.common.by import By
driver.find_element(By.XPATH, '//*[@id="PasteURL__HomePage"]')
Hamdi Jr

driver.find_element_by_xpath

driver.find_element_by_xpath('//*[@id="emailField"]')
Artemis

Se driver.find_element_by_xpath selnium java for exibido

if(driver.findElement(By.xpath("/html/body/div[2]/div/div/div/div/div/div/table/tbody/tr[6]/td[2]")).isDisplayed())
{    
    driver.findElement(By.linkText("logout")).getAttribute("href");          
} else {          
    driver.findElement(By.xpath("/html/body/div/div/div/a[2]")).click();
}
Mushy Manx

Elemento de seleção de selênio por id

driver.findElement(By.id("ui-datepicker-div"));
Xenophobic Xenomorph

maneiras de selênio de encontrar

elementcss= driver.findElement(By.cssSelector('div.nav-search-input'))
Panicky Pintail

Procure respostas de código populares por idioma

Procurar outros idiomas de código