-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXpath.py
More file actions
18 lines (12 loc) · 826 Bytes
/
Xpath.py
File metadata and controls
18 lines (12 loc) · 826 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
serv_obj=Service("C:\Driver\chromedriver_win32\chromedriver.exe")
driver=webdriver.Chrome(service=serv_obj)
driver.get("http://automationpractice.com/index.php")
driver.maximize_window()
#driver.find_element(By.XPATH,"/html[1]/body[1]/div[1]/div[1]/header[1]/div[3]/div[1]/div[1]/div[2]/form[1]/input[4]").send_keys("T-Shirt")
#driver.find_element(By.XPATH,"/html[1]/body[1]/div[1]/div[1]/header[1]/div[3]/div[1]/div[1]/div[2]/form[1]/button[1").click()
#driver.find_element(By.XPATH,"//input[@id='search_query_top']").send_keys("t-shirt")
#driver.find_element(By.XPATH,"//button[@name='submit_search']").click()
driver.find_element(By.XPATH,"//a[text()='Women']").click()