Solved

Automatic clicking of a button on a page

Posted on 2013-06-03
7
152 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
Industry Leaders: 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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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…

717 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