from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.firefox.options import Options
import time, traceback
def get_html(link):
service_log_path = './ghostdriver.log'
options = Options()
options.add_argument('-headless')
driver = webdriver.Firefox(executable_path="./geckodriver/geckodriver", firefox_options=options)
driver.get(link)
try:
time.sleep(1)
driver.find_element_by_id("uiPostPassword").send_keys("XXXXXXXXX")
driver.find_element_by_id("__ML_ok").click()
time.sleep(1)
driver.get("http://192.168.2.1/tools/tools.html")
time.sleep(1)
driver.find_element_by_id("__ML_restart_button").click()
time.sleep(1)
driver.switch_to_alert().accept()
print "airties success restarting"
except NoSuchElementException:
var = traceback.format_exc()
print var
get_html("http://192.168.2.1/loginmain.html")
25 Mayıs 2019 Cumartesi
Airties 5760 Auto Restart Code
Kaydol:
Kayıt Yorumları (Atom)
Hiç yorum yok:
Yorum Gönder