this is the script >>
import ClientForm
import urllib2
request = urllib2.Request("http://ritaj.birzeit.edu")
response = urllib2.urlopen(request)
forms = ClientForm.ParseResponse(response, backwards_compat=False)
response.close()
form = forms[0]
print form
sooform = str(raw_input("Form Name: "))
username = str(raw_input("Username: "))
password = str(raw_input("Password: "))
form[sooform] = [username, password]
request2 = form.click()
try:
response2 = urllib2.urlopen(request2)
except urllib2.HTTPError, response2:
pass
print response2.geturl()
print response2.info() # headers
print response2.read() # body
response2.close()
when start the script ,, i got this
Traceback (most recent call last):
File "C:/Python26/ritaj2.py", line 9, in <module>
form = forms[0]
IndexError: list index out of range
what is th problem,, i running on windows, python 2.6.4
Update:
I want a script that login this site, and print the response :)