Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automaticaly Click 1

Status
Not open for further replies.

rstum2005

Programmer
Jun 9, 2005
117
US
Is there a way to automatically click something?
 
Hire a monkey.

You can call the click method

button1_Click(button1, EventArgs.Empty);
 
Hire a monkey.

JurkMonkey, are you offering your services?

----------------------------------------

TWljcm8kb2Z0J3MgIzEgRmFuIQ==
 
um? let me explain...

I mean lets say I wanted to click a button on a website, and i want a console program to do this automatically.
 
Yes but you cannot get to it by tabing over and hitting enter.
 
Is it your website or someone elses?

Typically, a button submits a form to perform a specified action. You could implement javascript to submit the form for you.

Using a windowsapplication (not command line) you could add a reference to mshtml. You can then use the WebBrowser control axWebBrowser1 to capture the document and see if there's a way to use the button from there.

axWebBrowser1.LoadHTML(
//Once loaded (you may have to put this in the documentcomplete event handler)

mshtml.HTMLDocument doc = (mshtml.HTMLDocument)axWebBrowser1.Document;

then you may be able to play with a property in the doc.

This is pulled from my head so it's not accurate!


P.S. Guru7777 - I offer my services but I'm expensive :)
 
Nope it has a password. My console program goes to the site and opens a page. There is then a little toolbar on the page with an Excel icon which I have to click to download the spreadsheet. I could automate it using sendkey() but I cannot get to the button via TAB so i therfore must click it. This website is not my own.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top