selenium自动化之百度登录第三种方法
from selenium import webdriverfrom time import sleep
class baidu(object):
def openBrows(self):
self.web = webdriver.Firefox()
return self.web
def openUrl(self,url):
self.web.get(url)
self.web.implicitly_wait(10)
def closeo(self):
self.web.quit()
def baidu_in(self,url):
self.openBrows()
self.openUrl(url)
sleep(5)
self.closeo()
if __name__ =="__main__":
z = baidu()
z.baidu_in("http://www.baidu.com")
支持一下 :lol 顶一个!
页:
[1]