|
本帖最后由 xmyjk 于 2011-10-10 19:57 编辑
短信收到,程序如下:
- Option Explicit
- Sub a()
- Dim ie1 As Object, dmt As Object, r As Object, ARR, p&, ZKZ As String, SFZ As String, URL As String
- 'Load UserForm1
- 'UserForm1.Show 0
- On Error Resume Next
- Cells.NumberFormat = "@"
- Set ie1 = UserForm1.WebBrowser1
- ie1.Silent = True
- For p = 2 To [A65536].End(3).Row
- ZKZ = Cells(p, 1): SFZ = Cells(p, 2)
- URL = "http://www.sneac.com/gklqcx/lqjgcx_jg.jsp?wbzkzh=" & ZKZ & "&wbsfzh=" & SFZ
- Debug.Print URL
- With ie1
- .Navigate URL '网址
- Do Until .ReadyState = 4
- DoEvents
- Loop
- Set dmt = .Document
- End With
- Set r = dmt.All.tags("table")(4).All.tags("table")(3).Rows
- ARR = Array(r(0).Cells(1).innerText, Split(r(0).Cells(2).innerText, ":")(1), r(2).Cells(0).innerText, r(2).Cells(1).innerText, r(2).Cells(2).innerText)
- Cells(p, 3).Resize(1, UBound(ARR) + 1) = ARR
- Set dmt = Nothing
- Set r = Nothing
- Erase ARR
- Next
- Set ie1 = Nothing
- End Sub
复制代码- Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
- pDisp.Document.parentwindow.execScript "window.alert = null;window.confirm = null;window.open = null;window.showModalDialog = null;", "javascript"
- End Sub
复制代码
|
评分
-
4
查看全部评分
-
|