webdriver根据绝对路径标签id属性进行定位

webdriver根据绝对路径标签id属性进行定位

#encoding = utf-8
import time
from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()

#打开百度首页
driver.get("https://passport.meituan.com/account/unitivelogin?")
#根据绝对路径标签id属性进行定位
driver.find_element(by=By.XPATH,value='//*[@id="login-email"]').send_keys("134")
#暂停6秒
time.sleep(6)

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章