如何在表单内部的表中选择控件 - 机械化?

时间:2017-03-28 14:48:15

标签: python web-scraping html-table html-form mechanize-python



<form method="post" action="/user/user_login_prov.jsp">
    <table id="userpass" class="separator">
        <tr class="gap"><th>&nbsp;</th><td>&nbsp;</td></tr>
            <script type="text/javascript">
            //<![CDATA[
                this.onloads.push(function() {
                    redirectToPeerZd('');
                    document.getElementById('username').focus();
                });
            //]]>
            </script>
            <tr><th>User Name</th><td><input class="login_input" type="text" name="username" id="username" size="256" maxLength="256" AUTOCOMPLETE=OFF /></td></tr>
            <tr><th>Password</th><td><input class="login_input" type="password" name="password" id="password" size="64" maxLength="64" AUTOCOMPLETE=OFF /></td></tr>
            <tr><th></th><td align="right">
                <input type="submit" name="ok" value="Log In" />
                <!-- or <a href="javascript:history.back();">&lt; Back</a> -->
            </td></tr>
            <!--<tr class="gap"><th>&nbsp;</th><td>&nbsp;</td></tr>-->
    </table>
</form>
&#13;
&#13;
&#13;

上面给出的HTML是我的表单,我必须为表单中的<input>控件赋值 - &gt;表python mechanize。

我该怎么做?

0 个答案:

没有答案