相关疑难解决方法(0)

区分具有相同名称的html表单SELECT项

我正在尝试使用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识别它们?

html python mechanize

1
推荐指数
1
解决办法
1146
查看次数

标签 统计

html ×1

mechanize ×1

python ×1