Automatic clicking of a button on a page

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
Who is Participating?
Michel PlungjanConnect With a Mentor IT ExpertCommented:
Save as test.hta and run from a windows box' file system
var tId = "";
function monitor() {
  var but = window.frames["myIframe"].document.getElementById('button1');
  if (but) {
  else window.frames["myIframe"].reload(1);
<iframe name="myIframe" onload="monitor()" src="somepage.html"></iframe>

Open in new window

DISCLAIMER: you may violate the terms and conditions of the site
EEJUserAuthor Commented:
any takers?
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.

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Michel PlungjanIT ExpertCommented:
Not THAT hard.

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

Open in new window

EEJUserAuthor Commented:
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
Michel PlungjanIT ExpertCommented:
No. For that you need an HTA and an iframe
EEJUserAuthor Commented:
SOrry could you explain little about HTA with a example please?

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.