I'm trying to log into our PowerSchool server through Python and Mechanize, but I can't seem to successfully do it. A tricky part of this is that the login form only has a single field for inputting both my username and password, separated by a semicolon. Here is the webpage: https://powerschool.laalliance.org/admin/home.html
Can someone tell me if my code is correct?
br = mechanize.Browser()
br.set_handle_robots(False)
br.set_handle_refresh(False)
br.addheaders = [("User-agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:26.0) Gecko/20100101 Firefox/26.0")]
br.open('https://powerschool.laalliance.org/admin/')
br.select_form(name='LoginForm')
br.set_all_readonly(False)
#br.find_control('pstoken').readonly = False
#br.form['pstoken'] = '123123asdfasdf123123'
br.form['password'] = 'jdoe;' + pw
br.method = 'POST'
response = br.submit()
print response.read()