Open oltarasenko opened 9 years ago
we need more details to debug this issue, a sample html or at least the url to reproduce the error.
Yes, sorry: https://www.yooli.com/secure/login/ And the html is in gist: https://gist.github.com/oltarasenko/2b136b2e3791c0d27f75
Hey man, did you solve this problem? @oltarasenko
The page doesn't contain a FORM element, we can workaround it but the site seems to use javascript to submit the form and includes a verification (captcha?) step. It is unlikely we can automate it in loginform without lot of work.
Looks like the problem is that this website does not have form element. Do you think there is a way to handle such cases?
Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1178, in mainLoop self.runUntilCurrent() File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 800, in runUntilCurrent call.func(_call.args, _call.kw) File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 362, in callback self._startRunCallbacks(result) File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 458, in _startRunCallbacks self._runCallbacks() --- ---
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 545, in _runCallbacks
current.result = callback(current.result, _args, _kw)
File "/usr/lib/pymodules/python2.7/slybot/spider.py", line 119, in parse_login_page
args, url, method = fill_login_form(response.url, response.body, username, password)
File "/usr/lib/python2.7/dist-packages/loginform.py", line 74, in fill_login_form
form = _pick_form(doc.xpath('//form'))
File "/usr/lib/python2.7/dist-packages/loginform.py", line 42, in _pick_form
return sorted(forms, key=_form_score, reverse=True)[0]
exceptions.IndexError: list index out of range