from selenium import webdriver
import time

driver = webdriver.Chrome()
driver.get("http://localhost:8080/HKR")
driver.find_element_by_xpath("//*[@id='loginname' and @name='loginname']").send_keys("root")
driver.find_element_by_xpath("//*[@id='password' and @name='password']").send_keys("root")
driver.find_element_by_xpath("//*[@type='submit' and @id='submit' and @value='登陆']").click()
driver.maximize_window()
driver.find_element_by_xpath("//*[@name='time' and @class='show_tea']").send_keys("9（上晚自习）")
time.sleep(1)
driver.find_element_by_xpath("//*[@name='teaName' and @class='show_tea']").send_keys("贾生")
time.sleep(1)
driver.find_element_by_xpath("//*[@id='form_table']/tbody/tr[5]/td[3]/div/label[2]/div").click()
time.sleep(1)
driver.find_element_by_xpath("//*[@id='form_table']/tbody/tr[6]/td[2]/div/label[3]/div").click()
time.sleep(1)
driver.find_element_by_xpath("//*[@id='form_table']/tbody/tr[7]/td[3]/div/label[2]/div").click()
time.sleep(1)
driver.find_element_by_xpath("//*[@id='form_table']/tbody/tr[8]/td[2]/div/label[3]/div").click()
time.sleep(1)
driver.find_element_by_xpath("//*[@id='form_table']/tbody/tr[9]/td[2]/div/label[4]/div").click()
time.sleep(1)
driver.find_element_by_xpath("//*[@id='form_table']/tbody/tr[10]/td[3]/div/label[2]/div").click()
time.sleep(1)
driver.find_element_by_xpath("//*[@id='form_table']/tbody/tr[11]/td[2]/div/label[3]/div").click()
time.sleep(1)
driver.find_element_by_xpath("//*[@id='form_table']/tbody/tr[12]/td[2]/div/label[3]/div").click()
driver.find_element_by_xpath("//*[@id='textarea' and @name='suggestion']").send_keys("无意间")
time.sleep(3)
driver.find_element_by_xpath("//*[@id='subtn' and @class='login-button']").click()
time.sleep(2)
driver.find_element_by_xpath("/html/body/div[7]/div[3]/a/span/span").click()

driver.quit()