TA的每日心情 | 无聊 2017-6-14 11:31 |
---|
签到天数: 36 天 连续签到: 1 天 [LV.5]测试团长
|
from selenium import webdriver
class Baidu(object):
def __init__(self,url,kes):
self.base_url = url
self.ke = kes
def __del__(self):
self.browser.close()
def case_01(self):
self.browser = webdriver.Firefox()
self.browser.implicitly_wait(10)
self.browser.get(self.base_url)
self.browser.find_element_by_id("kw").send_keys(self.ke)
self.browser.find_element_by_id("su").click()
if __name__ == "__main__":
baidu = Baidu("http://www.baidu.com","seleniumq")
baidu.case_01()
|
|