Created
August 25, 2017 18:10
-
-
Save yasinkuyu/021b3584e7650a04a8a5042bef7b150f to your computer and use it in GitHub Desktop.
Selenium Python Zyxel (VMG3312-B10B) Router Reboot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def router_reset(): | |
print "Modem resetleniyor" | |
driver = webdriver.Chrome('./chromedriver') | |
driver.get('http://192.168.1.1/login.cgi') | |
username = driver.find_element_by_id('username') | |
password = driver.find_element_by_id('userpassword') | |
login = driver.find_element_by_xpath("//li[@class='login_button']//input[@type='submit']") | |
username.send_keys("admin") | |
password.send_keys("1234") | |
login.send_keys(Keys.ENTER) | |
time.sleep(1) | |
element_to_hover_over = driver.find_element_by_id("MT") | |
hover = ActionChains(driver).move_to_element(element_to_hover_over) | |
hover.perform() | |
time.sleep(1) | |
reboot = driver.find_element_by_xpath("//li[@id='MT-Reboot']//a") | |
reboot.click() | |
time.sleep(2) | |
driver.switch_to_frame('mainFrame') | |
#restart = driver.find_element_by_xpath("//form[@name='theform']") | |
#restart.submit() | |
restart = driver.find_element_by_name("sysSubmit") | |
restart.click() | |
print "Modem resetlendi" | |
time.sleep(2) | |
driver.switch_to_default_content() | |
okay = driver.find_element_by_xpath("/html/body/div[3]/div[3]/button[2]") | |
okay.click() | |
#driver.execute_script("arguments[0].click()", replace); | |
driver.close() | |
print "Resetleniyor..." | |
# modem tekrar başlama süresi | |
time.sleep(180) | |
print "Modem yeniden başlıyor." | |
print "..." |
dedeoglumrt
commented
Aug 9, 2021
via email
teşekkürler deneyeceğim
…On Sat, Aug 7, 2021, 12:30 PM V3YNjKbFGLSQ0FzpOu1s ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
Güncel, çalışan versiyonu burada:
https://gist.github.com/V3YNjKbFGLSQ0FzpOu1s/0d566925c91e61534436dd1d0a93da9f
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://gist.github.com/021b3584e7650a04a8a5042bef7b150f#gistcomment-3849670>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AF56NFBYG5X5NEHW4QM2SKLT3T4LNANCNFSM45UC3YCQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment