这是我的代码:
import mechanize
br = mechanize.Browser()
br.set_handle_robots(False)
br.set_handle_refresh(False)
br.addheaders = [('User-agent', 'Firefox')]
fitchsite = "https://www.fitchratings.com/jsp/general/login/LoginController.faces"
br.open(fitchsite)
br.select_form(name="loginForm")
br.form["loginForm:userName"] = "my username"
br.form["loginForm:password"] = "my password"
r = br.submit()
s = r.read()
print s
我试图登录fitch的网站,但获得formnotfounderror
,虽然表格肯定在那里并且有上述名称。