【问题标题】:Greasemonkey / Tampermonkey sript to click buttonGreasemonkey / Tampermonkey 脚本点击按钮
【发布时间】:2018-05-15 18:23:33
【问题描述】:

我有这个网站,我想点击“登录”按钮。 https://www.paycomonline.net/v4/ee/web.php/app/login

我玩过一些功能但没有成功(我不是网络编码员/程序员)。

创建按钮的行是:
<button type="submit" name="submit" id="btnSubmit" class=" waves-effect waves-light" aria-label="Log In">Log In</button>

谁能帮帮我? 提前致谢!

表格的完整代码是:

<form role="form" action="" method="post" >
 <div class="cardContainer shadow padding marginBottom formGroup row">
  <div class="row formRowStandard ">
   <label class="standard" for="txtlogin"><span class="required">*</span>Username</label>
    <div class="formLine">
     <div class="formControl fbControl">
      <input type="text" name="username" type="text" name="username" id="txtlogin" size="25" maxlength="75" placeholder="Username" class=" inputBoxBorder" aria-label="Username" required="required" value="">
     </div>
    </div>
   </div>
   <div class="row formRowStandard ">
    <label class="standard" for="txtpass"><span class="required">*</span>Password</label>
     <div class="formLine">
      <div class="formControl fbControl"><input type="password" name="userpass" type="password" name="userpass" id="txtpass" size="25" maxlength="20" placeholder="Password" autocomplete="off" class=" checkForCapslock inputBoxBorder" aria-label="Password" required="required" value="">
     </div>
    </div>
   </div>
   <div class="row formRowStandard "><label class="standard" for="userpinid"><span class="required">*</span>Last 4 digits of SSN</label>
    <div class="formLine">
     <div class="formControl fbControl"><input type="password" name="userpin" type="password" name="userpin" id="userpinid" size="25" maxlength="4" placeholder="Last 4 digits of SSN" class=" inputBoxBorder" aria-label="Last 4 digits of SSN" required="required" value="">
    </div>
   </div>
  </div>
  <div class="row formRowStandard ">
   <div class="formLine">
    <div ><button type="submit" name="submit" type="submit" name="submit" id="btnSubmit" class=" waves-effect waves-light" aria-label="Log In">Log In</button>
    </div>
   </div>
  </div>
 </div>
</form>

【问题讨论】:

  • 在询问 SO 之前您尝试过什么?能否请您发布您的代码。请记住,Stackoverflow 不是编码服务。除非您发布一些代码,否则不要提供答案
  • 我尝试过使用:'unsafeWindow.$("submit").click();'除了将“提交”更改为“登录”和“btnSubmit”之外,这些都不起作用。

标签: button click greasemonkey tampermonkey


【解决方案1】:

实际上可以使用:

document.getElementById("btnSubmit").click();

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-22
    • 1970-01-01
    相关资源
    最近更新 更多