Here is a simple script:
If you need help with this then please refer to the Python documentation.
site = "www.mysite.com"
form = "/cgi-bin/form.py" #the path to the login form processor
username = "MyName"
password = "MyPassword"
form_data = "?USERNAMEFIELD=%s&PASSWORDFIELD=%s"%(username, password) #Change USERNAMEFIELD and PASSWORDFIELD for the form you are using
wait = 10 #Wait period 10 minutes if site is busy.
login_ok = "Thank you for logging in" # Some text that would be on the page if login was okay
conn = httplib.HTTPConnection(site)
resp = conn.getresponse()
if resp.status == 404:
print "Webpage not found"
data1 = resp.read()
if data1.find(login_ok) != -1:
print "Logged in"
print "Trying again in ", wait, "minutes"