?
Solved

Automatic clicking of a button on a page

Posted on 2013-06-03
7
Medium Priority
?
157 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
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…
Suggested Courses

850 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