|
3学分
- Sub zhua()
-
- '创建对象
- Dim xmlHttp As Object
- Set xmlHttp = CreateObject("MSXML2.XMLHTTP")
- '发送请求
- xmlHttp.Open "GET", "https://d998cp.cc/result/HF_HNWFC", False
- xmlHttp.send
-
- '等待响应
- Do While xmlHttp.ReadyState <> 4
- DoEvents
- Loop
- '得到请求数据
- Dim Myhtml As String
- Myhtml = xmlHttp.responseText
- Dim jg As String
- jg = Split(Split(Myhtml, "<table class=""table___2m6aC"">")(1), "</td>")(0)
- Range("a2").Resize(UBound(jg), 6) = jg
- End Sub
复制代码 Split(Split(Myhtml, "<table class=""table___2m6aC"">")(1), "</td>")(0)这一句搞不懂字母截取数据,找到网页元素途径,填着不对,都是网页开头
大佬帮我搞下,怎么抓取数据
下面附件是样板
爬数据.rar
(12.03 KB, 下载次数: 11)
|
|