如果你网页里最后加入了jquery,那么就更方便了。可以直接用:WV.ExecuteScript "$('#btn1').click();"
前提是里面的初始化代码改成下面这样。
WV.NavigateToString "<!DOCTYPE html><html><head><title>AppTitle</title></head><body>" & _
"<div>Hello World...</div>" & _
"<input id='txt1' value='foo'>" & _
"<button id='btn1' onclick='btn1_click_test()' >Button1</button>" & _
"</body></html><script src='
https://cdn.staticfile.org/jquery/1.11.2/jquery.min.js'></script>"
如果你是打开一张网页的可以在Private Sub LocalWebViewInit()里面加下面一行即可:
WV.AddScriptToExecuteOnDocumentCreated "<script src='
https://cdn.staticfile.org/jquery/1.11.2/jquery.min.js'></script>"