Closed dangra closed 10 years ago
fails to detect this valid form:
$ python -m loginform https://www.osibatteries.com/signin.aspx Traceback (most recent call last): File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/home/daniel/src/loginform/loginform.py", line 106, in <module> sys.exit(main()) File "/home/daniel/src/loginform/loginform.py", line 99, in main values, action, method = fill_login_form(args.url, r.text, args.username, args.password) File "/home/daniel/src/loginform/loginform.py", line 79, in fill_login_form userfield, passfield = _pick_fields(form) File "/home/daniel/src/loginform/loginform.py", line 58, in _pick_fields raise ValueError("Unrecognized login form: %s" % dict(form.inputs)) ValueError: Unrecognized login form: {'__VIEWSTATE': <InputElement 12e82b8 name='__VIEWSTATE' type='hidden'>, 'ctl00$PageContent$ctl00$ctrlRecoverPassword$UserNameContainerID$UserName': <InputElement 12e8208 name='ctl00$PageContent$ctl00$ctrlRecoverPassword$UserNameContainerID$UserName' type='text'>, 'ctl00$PageContent$ctl00$ctrlLogin$Password': <InputElement 12e8100 name='ctl00$PageContent$ctl00$ctrlLogin$Password' type='password'>, 'ctl00$PageContent$ctl00$ctrlLogin$LoginButton': <InputElement 12e81b0 name='ctl00$PageContent$ctl00$ctrlLogin$LoginButton' type='submit'>, 'ctl00$PageContent$ctl00$ctrlLogin$RememberMe': <InputElement 12e8158 name='ctl00$PageContent$ctl00$ctrlLogin$RememberMe' type='checkbox'>, '__EVENTVALIDATION': <InputElement 12e8470 name='__EVENTVALIDATION' type='hidden'>, 'ctl00$PageContent$ctl00$ctrlLogin$UserName': <InputElement 12e80a8 name='ctl00$PageContent$ctl00$ctrlLogin$UserName' type='text'>, 'ctl00$PageContent$ctl00$ctrlRecoverPassword$UserNameContainerID$btnRequestNewPassword': <InputElement 12e8260 name='ctl00$PageContent$ctl00$ctrlRecoverPassword$UserNameContainerID$btnRequestNewPassword' type='submit'>}
fails to detect this valid form: