Selenium网络驱动程序如何防止网站登录?Selenium无法使用网络驱动程序登录
同时您可以手动输入登录表单,并且硒代码的所有其他部分都能正常工作,这是如何实现的?
是否有可能通过Selenium网络驱动程序登录到此类网站?
<!-- login form -->
<form action="login.php?do=login" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, 0)">
<script type="text/javascript" src="clientscript/vbulletin_md5.js?v=387"></script>
<table cellpadding="0" cellspacing="3" border="0">
<tr>
<td class="smallfont" style="white-space: nowrap;"><label for="navbar_username">Имя</label></td>
<td><input type="text" class="bginput" style="font-size: 11px" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="101" value="Имя" onfocus="if (this.value == 'Имя') this.value = '';" /></td>
<td class="smallfont" nowrap="nowrap"><label for="cb_cookieuser_navbar"><input type="checkbox" name="cookieuser" value="1" tabindex="103" id="cb_cookieuser_navbar" accesskey="c" />Запомнить?</label></td>
</tr>
<tr>
<td class="smallfont"><label for="navbar_password">Пароль</label></td>
<td><input type="password" class="bginput" style="font-size: 11px" name="vb_login_password" id="navbar_password" size="10" tabindex="102" /></td>
<td><input type="submit" class="button" value="Вход" tabindex="104" title="Введите ваше имя пользователя и пароль, чтобы войти, или нажмите кнопку 'Регистрация', чтобы зарегистрироваться." accesskey="s" /></td>
</tr>
</table>
<input type="hidden" name="s" value="" />
<input type="hidden" name="securitytoken" value="1494435076-6acf057fb2e17e28bd5679c57501a85f896b4310" />
<input type="hidden" name="do" value="login" />
<input type="hidden" name="vb_login_md5password" />
<input type="hidden" name="vb_login_md5password_utf" />
</form>
<!--/login form -->
由于您不在正确的页面上,或者您没有为您的输入和提交选择正确的元素,所以可能实际上无法登录。请举例说明一些代码。 – ElementCR
我无法理解这个问题? Selenium无法保护网站免受登录。 – demouser123
@ElementCR你可以说这个登录表单吗? – thinker