python模拟打开百度网页并搜索内容

#!/usr/bin/python
# -*- coding:utf8 -*-

import time
from selenium import webdriver
driver = webdriver.Chrome()

driver.get('http://www.baidu.com/')

time.sleep(5)

driver.find_element_by_id("kw").send_keys(u"青岛")
driver.find_element_by_id("su").click()

你可能感兴趣的:(Python)