|
新浪微博- Sub wb()
- Dim htm As New WinHttpRequest, str As String
- Dim reg As New RegExp
- Dim ar, arr, i, j, m, n
- With htm
- .Open "GET", "http://weibo.com/friends?leftnav=1&wvr=6&isfriends=1&step=2", False
- .SetRequestHeader "cookie", _
- "SUE=es%3Df01xxxxxxxx%253D%26rv%3D0" & _
- ";SUP=cv%3Dxxxxxxxxxxxx"
- .Send
- str = .ResponseText
- Debug.Print str
- With reg
- .Global = True
- .MultiLine = True
- .Pattern = "\s"
- str = .Replace(str, "")
- .Pattern = "nick-name=\""(.*?)\\.*?content\"">(.*?)<a"
- Set ar = .Execute(str)
- End With
- End With
- ReDim arr(0 To ar.Count - 1, 1)
- For i = 0 To ar.Count - 1
- For j = 0 To 1
- arr(i, j) = ar.Item(i).SubMatches(j)
- Next
- Next
- Sheet1.Cells(3, 1).Resize(65533, 4).ClearContents
- n = Sheet1.Range("a65533").End(xlUp).Row
- Sheet1.Cells(n + 1, 1).Resize(ar.Count - 1, 2) = arr
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|