如何将07excel中罗列的网站自动获取每个网页中特定位置的信息,并将其自动抓取到excel中
1个回答
展开全部
Sub 提取网页信息()
Dim IE As Object, srg$, brr(1 To 5)
Set IE = CreateObject("Microsoft.XMLHTTP")
For i = 1 To 5
a = Right(Cells(i, 1).Value, 9)
With IE
.Open "get", "http://www.hmdb.ca/metabolites/" & a, False
.send
srg = .responsetext
End With
sr = Split(Split(Split(srg, "<th>Origin</th>")(1), "</li>")(0), "<li>")(1)
brr(i) = sr
Next
[b1].Resize(UBound(brr)).Clear
[b1].Resize(UBound(brr)) = Application.Transpose(brr)
End Sub
试一下,祝你好运!
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询