Solved

Automatic clicking of a button on a page

Posted on 2013-06-03
7
151 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
Independent Software Vendors: 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 500 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
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…

733 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