Auto Click button/link on GoToMeeting

With GoToMeeting and Windows 7 there is a bug that it requires you to launch their software each time you start or join a meeting. I would like to automate clicking this link with a small app that I have started.  So when a user clicks a button in the app, it takes them to the gotomeeting page, and auto clicks on the "Launch Software" link. Any guidance would be appreciated.
I tried using the WebBrowser function, but haven't had luck.

Thanks!
Shaggy1Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rikin ShahMicrosoft Dynamics CRM ConsultantCommented:
I'm not sure if your program uses Windows.Forms, so this might not help at all. But, if you're using

System.Windows.Forms.WebBrowser to load your html form:
HtmlElement el = webBrowser1.Document.All["mybutton"];
object obj = el.DomElement;
System.Reflection.MethodInfo mi = obj.GetType().GetMethod("click");
mi.Invoke(obj, new object[0]);
or, if you're using mshtml:
HtmlElement el = webBrowser1.Document.All["mybutton"];
mshtml.HTMLInputElement el2 = (mshtml.HTMLInputElement)el.DomElement;
el2.click();

Hope this helps.
0
Shaggy1Author Commented:
Rikin,

Thanks for the help , appreciated. getting an error running this code: "Object Reference not set to an instance of an object" ...


 webBrowser1.AllowNavigation = true;
            webBrowser1.Navigate(targetURL);

            try
            {
                HtmlElement el = webBrowser1.Document.All["submit"];
                object obj = el.DomElement;
                System.Reflection.MethodInfo mi = obj.GetType().GetMethod("click");
                mi.Invoke(obj, new object[0]);              

            }

            catch (NullReferenceException  nre)
            {
                MessageBox.Show(nre.Message);
            }

Open in new window

0
Rikin ShahMicrosoft Dynamics CRM ConsultantCommented:
try this if it works-
 
HtmlElement button = webBrowser1.Document.GetElementById("ButtonID");
if (button != null)
    button.InvokeMember("click");

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Shaggy1Author Commented:
Here is how i got it to work....

private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {

            HtmlElementCollection links = webBrowser1.Document.GetElementsByTagName("a");
            foreach (HtmlElement link in links)
            {

                if (link.InnerText.Equals("Launch Software"))
                {
                    link.InvokeMember("click");
                }

            }          
                      
        }

Open in new window

0
Shaggy1Author Commented:
Both comments provided the working solution
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.