0

I need to go to a webpage, and click a button (called "Generate Daily Trends", as shown in the picture below), and click it again every 1 minute.

Is there any way (e.g., script or code) that I can automatically "click" the button every minute? To clarify: I want to achieve the effect (on the network and the server) of clicking the button, as opposed to actually doing something with the mouse. For example, I should be able to do other things on my workstation while this is running in the background.

This needs to be done in a Linux machine.

0

This is not really a UNIX answer, but if you don't mind leaving it running in the browser:

window.setInterval(function () {
    document.getElementsByName('GENERATE_DAILY_TRENDS')[0].click();
}, 1000); // 1000 milliseconds

And if you want a bookmarklet that you can click to get it going (once you're already on the page), add this for the bookmark url:

javascript:(function() {
    window.setInterval(function () {
        document.getElementsByName('GENERATE_DAILY_TRENDS')[0].click();
    }, 1000);
}());
2

You could use xdotool to get your mouse at your desired position and click the button:

xdotool mousemove 100 100 click 1
  • Can you please see my update>? – andy_ttse Mar 26 '15 at 1:57
  • 1
    You could use curl or wget and pass the web page you are trying test – dgsleeps Mar 26 '15 at 2:01
  • Ok. Thank you. Is this call a http request or what? Can you tell me the terminology that I could look it up (In the past, I have used wget and curl to download file). What terminology that describe my problem? Is it call POST http? – andy_ttse Mar 26 '15 at 2:04
  • 1
    You could call it a post request method – dgsleeps Mar 26 '15 at 2:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.