用TIMER时怎么得到IE的源码
- VB code
Private Sub Form_Load()Dim ie As InternetExplorerDim sWind As ShellWindowsSet ie = CreateObject("internetexplorer.application")ie.Visible = Trueie.navigate ("http://www.baidu.com/")End SubPrivate Sub Timer1_Timer()On Error Resume NextSet sWind = New ShellWindowsFor Each ie In sWind If ie.Busy = False Then If LCase(Mid(ie.locationURL, 1, 4)) <> "file" Then If ie.locationURL = "http://www.baidu.com/" Then Print ie.document.documentElement.outerHTML 'ie.document.getElementById("TextBox1").Value = "chenlin3" ' ie.document.getElementById("TextBox2").Value = "888888" ' ie.document.getElementById("Button1").Click End If End If end ifNextEnd Sub[解决办法]
因为一开始打开软件的时候网页还没下载完成,所以上面显示的内空僦是空白。
再说PRINT是从上往下打印,一个窗体就这么小,一个网页内容要几个窗体这么高才能显示下来,所以只能每次CLS清空一下