dongmi9494 2016-10-13 02:04
浏览 38

想要以编程方式单击网站按钮

I want to Click on a Website button that are already going on. For example: like url: www.google.com.. I want to Click Google Search button programmatically by using any method in PHP, Javascript, Jquery and Ajax. if Anyone know Solution. Please tell my and provide the source code.

Note: We dn't need to create own button we want to click on a website button by using class and id.

I want to try this..look like this but not success..I want to click Learn HTML button that are show on iframe...in w3school website..

<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<iframe src="http://www.w3schools.com" width="800" height="400"></iframe>

<script>
//setInterval(function () {$("#hand_1151079882").click();}, 3000);

function clime(){
setInterval(function () {document.getElementById("#w3-btn").click();}, 3000);
alert();
}
//using javascript 
$(document).ready(function () {
$(".cli").on('click', function(event){
    $("#w3-btn").trigger('click');
});

});

</script>
<input type="button" class="cli" name="clime" value="submit" onclick="clime()">
  • 写回答

3条回答 默认 最新

  • doufeixuan8882 2016-10-13 02:14
    关注

    You seem to be missing the element with the id w3-btn which gets clicked programmatically.

    Also, it seems both of these are doing the same thing ...

    function clime(){
    setInterval(function () {document.getElementById("#w3-btn").click();}, 3000);
    alert();
    }
    

    and

    $(document).ready(function () {
    $(".cli").on('click', function(event){
        $("#w3-btn").trigger('click');
    });
    
    });
    

    both are trying to click an element with id w3-btn, just in different ways. You only need one of them.

    评论

报告相同问题?

悬赏问题

  • ¥15 Mac系统vs code使用phpstudy如何配置debug来调试php
  • ¥15 目前主流的音乐软件,像网易云音乐,QQ音乐他们的前端和后台部分是用的什么技术实现的?求解!
  • ¥60 pb数据库修改与连接
  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)