[Selenium] 从一个实例开始,访问Baidu并进行关键字搜索

from selenium import webdriver
import time
from selenium.webdriver.common.keys import Keys

borwser=webdriver.Chrome(executable_path='C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe')
borwser.get('https://www.baidu.com/')
elem=borwser.find_element_by_id('kw')
elem.send_keys('python')
elem.send_keys(Keys.RETURN)

time.sleep(20)
borwser.close()

猜你喜欢

转载自blog.csdn.net/huanghong6956/article/details/86650512
今日推荐