from selenium import webdriver
from selenium.webdriver.common.by import By
import time
wd = webdriver.Chrome()
wd.get("https://www.baidu.com")
a = wd.find_element(By.XPATH,"//input[@id = 'kw']")
等待
#隐式等待
wd.implicitly_wait(秒数)
#强制等待
time.sleep(秒数)
点击元素
a.click()
输入框输入
a.send_keys('web自动化') --对元素做输入操作
a.clear --清空
获取展示在界面上的文本信息(有返回值)
b = a.text
print(b)