自动填写特定的登录表单

时间:2018-03-30 19:00:07

标签: javascript html

有没有可能填写特定的登录表单作为Pinterest的JavaScript格式?

这是链接 - https://www.pinterest.com/login/

一些提示:

  

登录字段的ID是“email”

     

密码字段的ID是“密码”

没有机会填写:

Stats

因为点击“登录”或点击文本字段后输入的数据将消失。

1 个答案:

答案 0 :(得分:0)

在这个答案中,我假设您拥有所需信息的变量。如果您希望浏览器为您自动填充,可以在此处执行此操作:Enabling browser's form auto-filling

这是一个片段:



// You can change this to whatever you want to autofill
var username = "Anything You Want";

// window.onload makes sure that we are not trying to get the
// element before it is ready
window.onload = function() {
  // .value is because this is a input tag
  document.getElementById("username").value = username;
};

<input id="username">
&#13;
&#13;
&#13;