像真实用户一样以编程为编程填充密码字段



我的输入字段如下

<input type="password" placeholder="Password" autocorrect="off" maxlength="30" autofocus="autofocus" animate="true" label="" rules="[object Object]">

和按钮如下

<button type="submit" class="button-orange wide">Login <!----></button>

所以我用纯JavaScript填充密码,如下

document.querySelectorAll('input[type=password]')[0].value = "12345";
document.querySelectorAll('.button-orange')[0].click();

问题是实际的网站是跟踪键盘或其他内容,当我专注于输入密码选项卡,填充密码填充空白时,它总是向我提醒密码。

我如何像真实的人一样填充密码。

可能是您必须将字段重新属性设置为true,以通过JavaScript

填充值之后
document.querySelectorAll('input[type=password]')[0].value = "12345";
document.querySelectorAll('input[type=password]')[0].readOnly = true;

最新更新