我正在尝试以这样的形式填写 3 个选择字段。
br.select_form(name='frmentermemorableinformation1')
br['frmentermemorableinformation1:strEnterMemorableInformation_memInfo1'] = ['g']
运行程序时出现以下错误。
ItemNotFoundError: insufficient items with name 'g'
这是相关表单的开始,也是 3 个选择输入中的第一个。
<form id="frmentermemorableinformation1" name="frmentermemorableinformation1" method="post" action="/personal/a/logon/entermemorableinformation.jsp" class="validationName:(frmentermemorableinformation1) validate:()" autocomplete="off" enctype="application/x-www-form-urlencoded">
<fieldset class="memInfoSelect clearfix"><div class="formField validate:(oneSelectFieldRequired) validationName:(memorableInformation) clearfix"><div class="formFieldInner"><div class="clearfix"><label for="frmentermemorableinformation1:strEnterMemorableInformation_memInfo1">Character 5  </label><select id="frmentermemorableinformation1:strEnterMemorableInformation_memInfo1" name="frmentermemorableinformation1:strEnterMemorableInformation_memInfo1"><option value="-">Select</option><option value="&nbsp;a"> a</option><option value="&nbsp;b"> b</option><option value="&nbsp;c"> c</option><option value="&nbsp;d"> d</option><option value="&nbsp;e"> e</option><option value="&nbsp;f"> f</option><option value="&nbsp;g"> g</option><option value="&nbsp;h"> h</option><option value="&nbsp;i"> i</option><option value="&nbsp;j"> j</option><option value="&nbsp;k"> k</option><option value="&nbsp;l"> l</option><option value="&nbsp;m"> m</option><option value="&nbsp;n"> n</option><option value="&nbsp;o"> o</option><option value="&nbsp;p"> p</option><option value="&nbsp;q"> q</option><option value="&nbsp;r"> r</option><option value="&nbsp;s"> s</option><option value="&nbsp;t"> t</option><option value="&nbsp;u"> u</option><option value="&nbsp;v"> v</option><option value="&nbsp;w"> w</option><option value="&nbsp;x"> x</option><option value="&nbsp;y"> y</option><option value="&nbsp;z"> z</option><option value="&nbsp;0"> 0</option><option value="&nbsp;1"> 1</option><option value="&nbsp;2"> 2</option><option value="&nbsp;3"> 3</option><option value="&nbsp;4"> 4</option><option value="&nbsp;5"> 5</option><option value="&nbsp;6"> 6</option><option value="&nbsp;7"> 7</option><option value="&nbsp;8"> 8</option><option value="&nbsp;9"> 9</option></select></div>
我到底做错了什么,我尝试添加&nbsp;
到 incase 的开头,这是问题,但我在替换g
时遇到了同样的错误。谢谢。'&nbsp;g'
'g'