Well recently my ISP updated their systems and made compulsory web login before giving access to any other site. I found this very frustrating and didnt liked it. Every time I start my modem I have to login to this ISP web login form.
So I just think to automate this process, I wrote a small python script to automate this login process. So as per my convenience I can put it in auto-run after login or whatever I want. Since I am lazy programmer I searched for a library which gave me easy manipulation of web forms. So I found mechanize module for python doing things which were necessary for this script. (Dont ask me why python , I dont want to start unother python Vs xyz Language fight. I like python very much so python :-) )
For easy usage of script I will briefly describe 5 parameters which are needed to be set one time before using this script.
loginURL = "http://login.example.com" # URL to Login form of ISP site
Here you have to put URL of the login page where the login form is shown
loginID = "myUserName" # ISP user nameloginPassword = "mYp4ssw0rd" # ISP Password
Quiet self explanatory : Username and password
loginFormName = "loginForm"
On the login page of the ISP site, check the html code for
successString = """NOW ACTIVATING YOUR SERVICES"""
Do a manual login and check the first page shown after login and copy any string from that page which is shown every time you login. This is used to check whether the login was successfull.
Comments are welcome.
Download script here
PythonScript ISPlogin.py