[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Automatic clicking of a button on a page

Posted on 2013-06-03
7
Medium Priority
?
156 Views
Last Modified: 2013-06-19
Hi JS Gurus

I work on bidding cars from a auction site. For the past few months I have been constantly losing on any car that I bid in. I strongly suspect that our competitors use a program to bid rather than human way.

I want a simple javascript program that can automate my bidding process.  This is the process that i follow:

      a. First find a list of cars that i am interested in bidding
      b. For each of this car, I  go to the final confirmation page to buy
      c. The bid opens exactly at 4 . At 4 , the final confirmation page will have a button visible - "Submit your bid". I can get the id of the button and code behind it.
      
      
My need is to write a simple JS browser extension where by the code checks the page every few milliseconds and checks for the availability of the button and if it's found , clicks the button .
As I previously mentioned the button appears only at 4PM, so the code has to run milliseconds before 4 and I should be able to configure the time to execute it in milliseconds
It has to work in chrome & FF
      
Many thanks
Sun
0
Comment
Question by:EEJUser
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 

Author Comment

by:EEJUser
ID: 39218967
any takers?
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39219469
A browser extension is not a trivial piece of work.  We handle questions, this is a project, and you need to hire someone who is in the business of developing browser addons.

Cd&
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 39219621
Not THAT hard.

(function() { 
  var tId1 = setInterval(function() { 
    var t = new Date(); 
    if(t.getHours()==15 && t.getMinutes()==59 && t.getSeconds()==59) { 
      clearInterval(tId1);
      var tId2=setInterval(function() {
        var but = document.getElementById('someButton');
        if (but) {
          clearInterval(tId2);
          but.click();
        }
      },10);
    }
  },1000); /* every second */
})();

Open in new window

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:EEJUser
ID: 39220084
Thanks mplungjan. But does this code refresh the page if the button is not found?

Cobol - Even a javascript code would do , no browser addon required. thanks

- Sun
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 39220247
No. For that you need an HTA and an iframe
0
 

Author Comment

by:EEJUser
ID: 39238798
Hi
SOrry could you explain little about HTA with a example please?

Thanks
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 2000 total points
ID: 39239225
Save as test.hta and run from a windows box' file system
<html>
<head>
<title></title>
<script>
var tId = "";
function monitor() {
  var but = window.frames["myIframe"].document.getElementById('button1');
  if (but) {
     clearInterval(tId);
     but.click();
     return;
  }
  else window.frames["myIframe"].reload(1);
}
</script>
<body>
<iframe name="myIframe" onload="monitor()" src="somepage.html"></iframe>
</body>
</html>

Open in new window


DISCLAIMER: you may violate the terms and conditions of the site
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question