我有一个这样的登录页面
<form method="POST" name="DefaultForm" action="SOME_URL" onSubmit="return (isReady(this));" autocomplete="off">
<input name="action" type="hidden" value="SOME_VALUE">
<input name="serverTimeStamp" type="hidden" value="SOME_VALUE">
<input name="clientTimeStamp" type="hidden" value="">
<input name="clientIP" type="hidden" value="SOME_VALUE">
<TABLE height="400" cellSpacing="0" cellPadding="0" width="540" align="center" background="images/bkground.gif" border="0">
...
<INPUT class="inputStyle" type="Input" name="username" size="20">
<INPUT class="inputStyle" type="password" maxLength="28" name="password" size="20">
...
</TABLE>
</form>
使用Python和lxml/Requests模块
^{pr2}$但是我不能让它工作,find()总是返回None总是到else块。有人能提出解决办法吗?在
为什么看不到是因为表单是根元素:
只需执行上述操作:
^{pr2}$如果我们用div来包装表单:
现在div是根,find找到以下形式:
相关问题 更多 >
编程相关推荐