简体   繁体   中英

VB.NET connect to local website and trigger an event (button)

I really have no piece of code I can show you, because I have no idea how to even begin coding this.

I have to do the following with VB.NET:

  1. Connect to a local website ( https://10.0.0.55/ )
  2. Trigger an event on that specific page (button onClick)

     <div onClick="mySubmit('webEvent=START&webSector=0')">START</div> 

The only thing I know at the moment is that you can connect to the website through the WebClient.

    Dim webClient As New WebClient()
    webClient.BaseAddress = "http://10.0.0.55/"

Help would be greatly appreciated.

Thanks in advance,

Jens

You can use a WebBrowser control:

Navigate to the address:

webBrowser1.Navigate("https://10.0.0.55/")

The in the DocumentCompleted event you can invoke a click. Something like this:

webBrowser1.Document.GetElementById("id").InvokeMember("click")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM