|
楼主 |
发表于 2012-6-7 08:19
|
显示全部楼层
本帖最后由 蓝天630902 于 2012-6-7 08:40 编辑
批量下载:
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" _
(ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Sub 中国证券登记结算有限责任公司统计月报()
On Error Resume Next
With CreateObject("internetexplorer.application")
.Visible = True
For p = 1 To 5
.Navigate "http://www.chinaclear.cn/main/03/0304/0304_" & p & ".html"
While .ReadyState <> 4 Or .Busy
DoEvents
Wend
Set r = .Document.All.tags("table")(6).All.tags("a")
n = Range("a65536").End(xlUp).Row
For i = 0 To r.Length
s = Split(r(i).href, "/")
URLDownloadToFile 0, r(i).href, "D:\" & r(i).innerText & s(6), 0, 0
Next i
Next p
.Quit
End With
Set r = Nothing
End Sub
|
|