Help with python script

mjumrani

Skilled
Did not want to create a separate thread so I'll ask here,
Need some help from python experts
Attached are the login and logout script for reliance.

Now, suppose I disconnect the router wire and run either script, it runs for 20 seconds or so and then terminates even though it is unsuccessful in its task.

I want to make it wait for infinity or as close to it until its job is successfully over.

I don't know jack about python so need some assistance...
TIA
 
It might be silly, but did you enter your username or password

Code:
#!/usr/bin/env python

# encoding: utf-8

"""

Reliance Login Script for Python 2.x v1.0
Created by Kunal Dua on 2009-12-18

[url]http://www.kunaldua.com/blog/?p=330[/url]
This program is free software; you may redistribute it and/or

modify it under the same terms as Python itself.

"""
import urllib2, urllib, cookielib
[B]username = 'login' #replace the text within quotes with your username

password = 'password'	#replace the text within quotes with your password

[/B] 

jar = cookielib.FileCookieJar("cookies")

opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(jar))
response = opener.open("http://10.239.89.15/reliance/startportal_isg.do")
login_data = urllib.urlencode({'userId' : username, 'password' : password, 'action' : 'doLoginSubmit'})

resp = opener.open('http://10.239.89.15/reliance/login.do', login_data)

Btw, you should check solutions posted in comments

http://www.kunaldua.com/blog/2009/12/reliance-wireless-broadband-auto-login-script/
 
Back
Top