Dim ObjIE As Object = CreateObject("internetexplorer.application")
ObjIE.Navigate("url" )
Do While objie.ReadyState <> 4
Application.DoEvents
Loop
Dim neirong As System.Windows.Forms.HtmlElement
neirong = ObjIE.Document.getelementbyid("js_content")
Dim web As System.Windows.Forms.WebBrowser = e.Form.Controls("WebBrowser1").BaseControl
web.Document.window.Frames(0).Document.body.Innerhtml = neirong.Innerhtml
运行报错
无法将类型为“System.__ComObject”的 COM 对象强制转换为类类型“System.Windows.Forms.HtmlElement”。表示 COM 组件的类型实例不能强制转换为不表示 COM 组件的类型;不过,只要基础 COM 组件支持对接口 IID 的 QueryInterface 调用,就能将这些实例强制转换为接口。