我正在尝试使用Mechanize在Python中动态填充表单.但是,当我检查具有该表单的HTML页面的源时,我意识到表单上的某些控件具有相同的名称.以下是表格的摘录:
<form action="[some website]" method=post>
<table>
<tr><td>
<select NAME="mv_searchspec" size="1">
<option VALUE="1119">Fall 2011 (1119)</option>
<!-- other options here -->
</select>
</tr><td>
<tr><td>
<select NAME="mv_searchspec" size="1">
<option VALUE="">Select Department</option>
<option VALUE="ACC">ACC</option>
<!-- other options here -->
</select>
</tr></td>
</table>
</form>
Run Code Online (Sandbox Code Playgroud)
有没有办法获取每个SELECT控件的possible_items而不用名称/ id识别它们?