|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub aa()
Dim arr(1 To 100000, 1 To 12)
Cells.ClearContents
Set oDoc = CreateObject("htmlfile")
[a1:i1] = Array("序号", "省份", "初始注册", "变更注册", "延续注册", "增项注册", "重新注册", "遗失补办", "注销注册")
With CreateObject("MSXML2.XMLHTTP")
For p = 1 To 2
.Open "GET", "http://jzsgl.coc.gov.cn/archisearch/cxyjjzs/index.aspx" & p & "&type=1", False
.Send
oDoc.body.innerHTML = StrConv(.responsebody, vbUnicode)
Set r = oDoc.All.tags("table")(11).Rows
For i = 0 To r.Length - 1
k = k + 1
For x = 1 To 12
arr(k, x) = r(i).Cells(x - 1).innerText
Next
Next
Set r = Nothing
Next
End With
Range("A2").Resize(k, 12) = arr
End Sub
|
|