|
Sub test()
Dim url As String
Dim x As Object
Dim h As Object
Dim A, i, ele
A = Range("a1").CurrentRegion
For i = 2 To UBound(A)
url = "https://www.365area.com/hscode/detail/" & A(i, 1)
Set x = CreateObject("MSXML2.XMLHTTP")
Set h = CreateObject("htmlfile")
x.Open "GET", url, False
x.Send
h.body.innerhtml = x.responsetext
For Each ele In h.all
If ele.className = "odd green" Then A(i, 2) = ele.NextSibling.innerText: Exit For
Next
Next
[a1].Resize(i - 1, 2) = A
End Sub
除了这个商品代码,没别的测试,不知行不行
|
评分
-
1
查看全部评分
-
|