from selenium import webdriver
from time import sleep
class cms(object):
def init(self):
pass
def dl(self):
self.dx = webdriver.Chrome()
self.dx.get("http://cms.duoceshi.cn/manage/login.do")
self.dx.find_element_by_name("userAccount").send_keys("admin")
self.dx.find_element_by_name("loginPwd").send_keys("123456")
self.dx.find_element_by_xpath('//[@id="loginBtn"]').click()
def xtgl(self):
dx = webdriver.Chrome()
dx.get("http://cms.duoceshi.cn/manage/login.do")
dx.find_element_by_name("userAccount").send_keys("admin")
dx.find_element_by_name("loginPwd").send_keys("123456")
sleep(2)
dx.find_element_by_xpath("html/body/div/div/form/div[3]/label/input").click()
sleep(2)
dx.find_element_by_xpath("html/body/div/div/form/div[4]/input[1]").click()
dx.maximize_window()
sleep(2)
dx.find_element_by_xpath('//[@id="menu-system"]/dt').click()
sleep(3)
dx.find_element_by_link_text("退出").click()
def tc(self):
dx = webdriver.Chrome()
dx.get("http://cms.duoceshi.cn/manage/login.do")
dx.find_element_by_name("userAccount").send_keys("admin")
dx.find_element_by_name("loginPwd").send_keys("123456")
sleep(2)
dx.find_element_by_xpath("html/body/div/div/form/div[3]/label/input").click()
sleep(2)
dx.find_element_by_xpath("html/body/div/div/form/div[4]/input[1]").click()
dx.maximize_window()
dx.find_element_by_link_text("退出").click()
if name == 'main':
d=cms()
# d.dl()
# d.tc()
# d.xtgl()