Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

get xpath of element selenium python

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys

#your executable_path will be different!!
driver = webdriver.Chrome(executable_path="C:/Development/chromedriver.exe")


driver.get("https://www.linkedin.com/jobs/search/?currentJobId=3271146120&f_AL=true&geoId=102257491&keywords=python%20developer&location=London%2C%20England%2C%20United%20Kingdom&refresh=true")

button = driver.find_element(By.XPATH, '/html/body/div[3]/header/nav/div/a[2]')
button.click()

email_field = driver.find_element(By.XPATH, '//*[@id="username"]')
password_field = driver.find_element(By.XPATH, '//*[@id="password"]')
sign_in_field = driver.find_element(By.XPATH, '//*[@id="organic-div"]/form/div[3]/button')
 
PREVIOUS NEXT
Tagged: #xpath #element #selenium #python
ADD COMMENT
Topic
Name
9+9 =