#coding = utf-8标签:webdriver,driver,selenium,id,获取,import,find From: https://www.cnblogs.com/dongtian/p/17496884.html
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
#webdriver根据id获取元素
#打开chrome浏览器,输入百度搜索,搜索python相关信息
driver = webdriver.Chrome()
#打开百度首页
driver.get("https://www.baidu.com")
#输入框上送内容
driver.find_element(by=By.ID,value='kw').send_keys('python')
#点击搜索
driver.find_element(by=By.ID,value="su").click()
time.sleep(6)
driver.quit()