登录Web服务器不是我的专业领域,我希望自动执行登录Web服务器的任务,但我不确定如何格式化代码以实现此目标。我查看了其他页面,但无论我做了什么,我都得到了相同的回复。
网页摘要:
<form name="form1" action="login.cgi" method="POST" onsubmit="encrypt();">
<input type="hidden" name="Token" value="16">
<tr height="15">
<td><img src="/images/spacer.gif" alt="" height="15"></td>
</tr>
<tr height="32">
<td valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="19"><img src="/images/spacer.gif" alt="" width="19"></td>
<td width="100%"> </td>
</tr>
</table>
</td>
</tr>
<tr height="12">
<td><img src="/images/spacer.gif" alt="" height="12"></td>
</tr>
<tr>
<td height="1" valign="top">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"><img src="/images/spacer.gif" alt="" width="20"></td>
<td valign="top">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="/images/spacer.gif" alt="" width="10" height="8"></td>
<td><img src="/images/spacer.gif" alt="" width="400" height="8"></td>
</tr>
<tr>
<td nowrap>
<b>Login:</b>
</td>
<td>
<input name="userid_w" type="text" size="50">
<input name="userid" type="hidden" value=""><img src="/images/spacer.gif" alt="" width="10"></td>
</tr>
<tr>
<td colspan="2" height="3"><img src="/images/spacer.gif" alt="" height="3"></td>
</tr>
<tr>
<td nowrap>
<b>Login Password:</b>
</td>
<td>
<input name="password_w" type="password" size="50">
<input name="password" type="hidden" value="">
</td>
</tr>
<tr height="3">
<td colspan="2"><img src="/images/spacer.gif" alt="" height="3"></td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" value="Login">
....
<input type="hidden" name="open" value="">
</form>
</table>
无论我给出的userid_w或password_w值是什么,我从服务器获得的响应返回:
<html> <head></head> <body onload='document.form1.submit()'> <form name='form1' method='POST' action='message.cgi' target='_top'> <input type='hidden' name='title' value='MSG_TTL_COOKIEOFF'/> <input type='hidden' name='messageID' value='MSG_COOKIEOFF'/> <input type='hidden' name='buttonURL' value='Frame.cgi'/> <input type='hidden' name='screen' value='all'/> </form> </body></html>
任何帮助都将不胜感激。
编辑:在页面上运行curl -l会给出:
<html> <head></head> <body onload='document.form1.submit()'> <form name='form1' method='POST' action='/web/guest/en/websys/webArch/message.cgi' target='_top'> <input type='hidden' name='title' value='MSG_TTL_COOKIEOFF'/> <input type='hidden' name='messageID' value='MSG_COOKIEOFF'/> <input type='hidden' name='buttonURL' value='Frame.cgi'/> <input type='hidden' name='screen' value='all'/> </form> </body></html
这看起来像我的pythons脚本输出...