python urllib表单pos

2024-06-03 10:22:23 发布

您现在位置:Python中文网/ 问答频道 /正文

<div id="login-section">
    <fieldset class="validation-group">
        <table id="navLgnMember" cellspacing="0" cellpadding="0" style="border-collapse:collapse;">
    <tr>
        <td>
                    <div id="login-user">
                        <div class="input" id="username-wrapper">
                            <div class="loginfield-label"><a href="/help" title="click for help logging in" style="color: White; text-decoration: none">Number / ID / Email</a></div>
                            <div class="input-field-small float-left submit-on-enter"><div class="left"></div><input name="ctl00$ctl01$navLgnMember$Username" type="text" maxlength="80" id="Username" title="Username" class="center" style="width:85px;" /><div class="right"></div></div>
                        </div>
                        <div class="input" id="password-wrapper">
                            <div class="loginfield-label">
                                Password</div>
                            <div class="input-field-small float-left submit-on-enter"><div class="left"></div><input name="ctl00$ctl01$navLgnMember$Password" type="password" id="Password" title="Password" class="center" title="Password" style="width:85px;" /><div class="right"></div></div>
                        </div>
                        <div id="login-wrapper">
                            <input type="submit" name="ctl00$ctl01$navLgnMember$Login" value="" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$ctl01$navLgnMember$Login&quot;, &quot;&quot;, false, &quot;&quot;, &quot;https://tatts.com/tattersalls&quot;, false, false))" id="Login" class="button-login" />

                        </div>

如何从urllib提交此表单作为当前代码:

^{pr2}$

从网上提交的权利是离开公平的一部分。在

我正在尝试登录并创建一个会话,以便能够将更多的webform数据发布到站点的其他部分。在

提前谢谢。在


Tags: dividinputtitlestyleloginpasswordwrapper
1条回答
网友
1楼 · 发布于 2024-06-03 10:22:23

根据SO:Mechanize and Javascript的另一篇文章,您有不同的选择,从在Python中模拟javascript脚本在做什么,到使用完整的Selenium及其Python绑定。在

如果您尝试使用简单的Python方法,我强烈建议您使用一个网络间谍,例如优秀的wireshark来分析通过真实浏览器成功登录的实际接收和发送的内容,以及Python模拟发送的内容。在

相关问题 更多 >