Code: Select all
#!/usr/bin/env python
import mechanize
def twc():
theurl = 'https://services.twc.state.tx.us/UITAXSERV/security/logon.do'
br = mechanize.Browser()
br.set_handle_refresh(False)
br.set_handle_robots(False)
br.open(theurl)
print br.title()
print br.geturl()
def pageview(p):
f=open("test.html","w")
f.write(p)
f.close()
br.select_form("logonForm")
br.form["username"] = "dkfdf"#un
#br.form["password"] = ""#pw
print "entered user info"
br.submit()
html= br.response().read()
pageview(html)
print br.title()
print br.geturl()
twc()
The error, in .errorsHeader, should appear like this:
Please correct the following errors:
Password: Enter 6 to 32 characters.
The server should print this around line 283 in the html.