from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time

driver = webdriver.Chrome("D:\\software\chromedriver\chromedriver.exe")
driver.maximize_window()
driver.get("http://mywifi.mercku.tech")
time.sleep(1)
pwd = driver.find_element_by_class_name("has-icon")
pwd.click()
pwd.send_keys("22222222")
pwd.send_keys(Keys.RETURN)
time.sleep(1)
setting = driver.find_element_by_xpath("/html/body/div[1]/div/div/div/header/div[2]/ul/li[2]/div/div")
setting.click()
wifi_set = driver.find_element_by_xpath("/html/body/div[1]/div/div/div/header/div[2]/ul/li[2]/ul/li[1]")
wifi_set.click()
time.sleep(5)
Encryption = driver.find_element_by_xpath("/html/body/div[1]/div/div/div/div[1]/div[2]/div[2]/div[2]/div/div/div")
Encryption.click()
time.sleep(1)
wpa2 = driver.find_element_by_xpath("/html/body/div[1]/div/div/div/div[1]/div[2]/div[2]/div[2]/div/div/ul/li[3]")
wpa2.click()
save_btn = driver.find_element_by_class_name("btn")
save_btn.click()
save_cf = driver.find_element_by_xpath("/html/body/div[3]/div/div[2]/button[2]")
save_cf.click()
# login = driver.find_element_by_class_name("btn")
# login.click()