Skip to content

Instantly share code, notes, and snippets.

@karngyan
Last active November 3, 2018 10:36
Show Gist options
  • Save karngyan/2d34d56a0698c24f904d05b4f99ce87f to your computer and use it in GitHub Desktop.
Save karngyan/2d34d56a0698c24f904d05b4f99ce87f to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
'''
CC : Yasho Bhaiya
'''
from selenium import webdriver
import sys
webbrowser = webdriver.Firefox()
webbrowser.get("https://172.16.1.1:8090/httpclient.html")
search_form_password = None
search_form_username = None
while search_form_password == None or search_form_username == None:
search_form_username = webbrowser.find_element_by_name('frmHTTPClientLogin').find_element_by_class_name('maindiv').find_element_by_class_name('datablock').find_element_by_class_name('tablecss').find_element_by_id('usernametxt').find_element_by_name('username')
search_form_password = webbrowser.find_element_by_name('frmHTTPClientLogin').find_element_by_class_name('maindiv').find_element_by_class_name('datablock').find_element_by_class_name('tablecss').find_element_by_name('password')
search_form_username.send_keys(open(r"username.txt",'r').read())
search_form_password.send_keys(open(r"password.txt",'r').read())
search_form_submit = webbrowser.find_element_by_name('frmHTTPClientLogin').find_element_by_class_name('maindiv').find_element_by_class_name('datablock').find_element_by_class_name('tablecss').find_element_by_name('btnSubmit')
search_form_submit.click()
webbrowser.close()
sys.exit(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment