VB.NET WebBrowser click on button

37,959

The webbrowser control lets you access elements within the webpage and you can invoke methods on them, so something as simple as this will click the button:

webBrowser1.Document.All("yidHelperBtn").InvokeMember("click");
Share:
37,959
Ionut Ungureanu
Author by

Ionut Ungureanu

Updated on July 09, 2022

Comments

  • Ionut Ungureanu
    Ionut Ungureanu almost 2 years

    I am working at a small VB.NET project which autofill the fields on the Yahoo register page. Is there a way to click on "Check" button and see if the entered ID is OK or not?

    Something like if the entered ID is OK then proceed further with filling the field, if not, try another ID and press "Check" button again.

  • GianT971
    GianT971 about 13 years
    Indeed, as John said, you can also replace ' CheckButton.Focus() SendKeys.Send("{ENTER}") ' by WebBrowser1.Document.All("yidHelperBtn").InvokeMember("click‌​") It will do the same thing; however, you still have to wait for 1sec after the document is completed