有一个网站,我想创建可以自动执行登录过程的链接地址。
从登录页面源代码中,我了解到它会在表单中使用post方法提交id、passwd值。
但我想知道此表单提交导致的整个“url”地址。我的意思是,最终它会传递 id、passwd 值,如“somewebpage?id=someid&passwd=somepw”,对吗? (当然会通过表单用encodeURIComponent进行处理)
这个包含 url 地址的参数就是我正在寻找的,因为我想如果我知道这一点,那么我就可以自动化登录过程。
但是,该地址并未明确显示(甚至短暂显示)。有没有办法以某种方式“alert()”这个网址地址或通过 chrome 开发者工具或其他东西查看它?
顺便说一句,这是登录页面示例:
<form id="login" name="login" class="login" method="post"
action="" enctype="application/x-www-form-urlencoded"
style="background-image: url(../main/image/index.gif)">
<input type="hidden" name="url" value="../main/index.cgi" />
<table class="login-form">
<tr>
<td>
<table>
<tr>
<td class="label"><label for="login_id">ID</label></td>
<td class="input">
<input type="text" id="login_id" name="id" value="" onclick="select();" maxlength="8"/>
</td>
</tr>
<tr>
<td class="label"><label for="login_passwd">Passwd</label></td>
<td class="input">
<input type="password" id="login_passwd" name="passwd" value="" onclick="select();" maxlength="8"/>
</td>
</tr>
</table>
</td>
<td>
<input type="submit" id="login_submit" value="Go" />
</td>
</tr>
<tr>
</tr>
</table>
</form>
最佳答案
您应该能够在 firebug net 面板中看到 POST url。
关于javascript - 如何查看提交表单的 url 输出?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28468772/