Do not crash if an input does not have any type

This commit is contained in:
Florent 2014-03-20 11:51:03 +01:00
commit 4e6333fbcd

View file

@ -367,8 +367,11 @@ class Form(OrderedDict):
except KeyError:
continue
if inp.attrib['type'] in ('checkbox', 'radio') and not 'checked' in inp:
continue
try:
if inp.attrib['type'] in ('checkbox', 'radio') and not 'checked' in inp:
continue
except KeyError:
pass
if inp.tag == 'select':
options = inp.xpath('.//option[@selected]')