0
我想填寫一個HTML表單,我正在使用python的mechanize模塊。 我的HTML代碼是這樣,對於複選框和下拉式是:啓用複選框只有ID
的複選框:form.find_control("cd_info").items[0].selected = True
的下拉列表:form['cdtype']= ['Error1']
錯誤:
<div id="post_cd">
<input role="checkbox" id="cd_info" class="cbox" type="checkbox">
<span class="s-iso" style="display:none"></div>
<label for="type" id="cdtype" class="cd" style="width:60px;margin:1px;float:left;text-align:right;">CD type:</label>
<select id='cdtype' class=" ui-iso" style="width:100px;margin:1px;float:left;">
<option value="CD1">Error1</option>
<option value="CD2">Error1</option>
<option value="CD3">Error2</option>
</select>
我有以下,但得到的錯誤嘗試
raise ControlNotFoundError("no control matching "+description)
mechanize._form.ControlNotFoundError: no control matching name 'cd_info'
raise ControlNotFoundError("no control matching "+description)
mechanize._form.ControlNotFoundError: no control matching name 'cdtype'
這個什麼建議嗎? –