from selenium import webdriver
from time import sleep
driver = webdriver.Chrome()
URL = 'https://www.baidu.com/'
driver.maximize_window()
driver.get(URL)
# 定位到百度输入框,输入selenuim
# senf_keys()模拟键盘输入
driver.find_element_by_id("kw").send_keys("selenuim")
sleep(10)
# 清除输入的内容
driver.find_element_by_id('kw').clear()
sleep(10)
# 输入selenuim,并搜索
driver.find_element_by_id("kw").send_keys("selenuim")
sleep(2)
driver.find_element_by_id("su").click()