0

How would I go about making a program that clicks on a <input type="button"> button automatically? Could I do this using the WebClient class?

I am making the program using visual C#,but I am open to using other languages.

To be more specific about my problem:

there is a website I use that generates data upon clicking an input button on the users profile page. I want to make a program that clicks the input button for multiple users in order to update all their profiles at once, instead of manually visiting all their profiles and clicking the button on each persons profile.

Reuben Ward
  • 101
  • 1
  • 9
  • 1
    Why not calling the button click callback directly? – Tariq Nov 28 '14 at 06:42
  • Please clarify what you want to achieve. Are you looking for creating some sort of web bot? Simulate click on your own page? Simulate postback on your own ASP.Net site? something else? – Alexei Levenkov Nov 28 '14 at 06:45
  • there is a website I use that generates data upon clicking an input button on the users profile page. I want to make a program that clicks the input button for multiple users in order to update all their profiles at once. @AlexeiLevenkov – Reuben Ward Nov 28 '14 at 06:47
  • Search terms for such activity "web browser automation". There are many tools as well C# guides how to do so. – Alexei Levenkov Nov 28 '14 at 06:53

1 Answers1

3

you can directly call your button click event on pageload as:

 btnSave_Click(btnSave,null);

Or in Jquery:

$(document).ready(function(){

   $("[id*='btnSave']").click();
});
C Sharper
  • 8,284
  • 26
  • 88
  • 151