请教大神以下网站数据如何抓取?
http://ddx.gubit.cn/sz0.php
http://ddx.gubit.cn/sh0.php
http://ddx.gubit.cn/cyb.php
http://ddx.gubit.cn/new2.html
以下是数据源
http://ddx.gubit.cn/ygetszddxpm. ... =0.6813226370393328
{"data":[["002873","10.55","10.01","0.230","0.125","11578.557","-0.435","-3.897","1.458","5.557","6","1","542.93","947.52","57.3"],["002902","25.86","10.00","5.253","5.098","10770.704","4.301","-6.345","5.240","-49.865","3","1","20896.68","32148.74","65.0"],["002613","4.09","9.95","2.465","1.514","300.068","2.265","-0.026","-1.419","-13.139","5","1","6032.25","10224.16","59.0"],["000504","8.78","10.03","0.638","0.268","270.591","0.874","1.326","1.365","6.225","4","1","1726.55","3215.18","53.7"],["002313","9.63","10.06","4.276","3.062","169.110","4.698","-2.816","0.956","-47.602","5","1","15347.91","28741.41","53.4"],["002907","14.69","10.04","1.316","1.027","156.901","1.199","0.390","0.686","-8.077","3","1","5920.94","10944.43","54.1"],["002575","6.79","10.05","1.245","0.949","134.820","1.007","1.342","-1.174","-0.400","5","1","4787.48","13225.07","36.2"],["002775","2.84","10.08","1.039","1.161","105.975","1.213","-0.195","2.594","-8.304","3","2","1284.42","5076.77","25.3"],["001208","9.24","10.00","2.194","1.660","86.682","4.990","1.092","5.537","-10.008","5","3","4946.28","17602.40","28.1"],["002632","8.21","10.05","2.581","2.332","76.910","-0.275","1.983","-6.248","-16.828","6","1","11884.37","34150.49","34.8"],["002298","4.77","9.91","1.391","1.602","74.502","0.910","3.272","-1.332","-7.998","4","1","4161.85","16450.00","25.3"],["002599","6.45","10.07","4.535","5.132","71.281","5.281","11.392","4.648","-5.830","6","1","11387.03","32627.59","34.9"],["002087","1.30","4.84","0.349","0.711","70.189","-0.988","-2.291","-0.029","-0.316","0","2","367.38","1818.72","20.2"],["003004","22.75","10.01","1.380","0.605","66.010","1.835","1.557","2.150","-5.687","4","2","2144.98","6682.17","32.1"],["000815","10.09","10.03","2.204","1.568","62.974","1.822","0.173","-3.823","-22.557","2","1","14741.71","38896.33","37.9"],["000411","10.89","10.00","1.235","0.770","62.070","1.028","0.803","0.452","2.456","2","1","4212.10","14831.33","28.4"],["002388","4.50","6.13","1.288","3.420","56.003","1.128","1.768","0.001","-10.866","5","1","2915.09","17351.72","16.8"],["002793","4.52","9.98","0.544","0.371","51.094","0.561","0.476","2.295","2.262","5","1","2604.18","11945.79","21.8"],["000861","1.46","0.00","0.241","0.619","48.301","0.544","0.381","-3.005","-14.638","4","3","843.67","6203.45","13.6"],["002181","4.19","0.72","0.259","0.816","47.863","0.140","1.076","0.105","-9.027","6","2","1228.21","6978.45","17.6"]],"updatetime":"2024-03-08 15:00:00","total":1500,"page":1,"nowdate":"2024-03-09"}
以下脚本是我几年以前下载同样网站数据抓取的(忘记了作者名字),最近因为散户大家庭的数据经常断更没有更新,才想起来以前有这么一个文件,以前是可以运行抓取到数据的,现在发现脚本失效了,看看哪位大神能帮忙修改一下?脚本如下:
Sub 查股网个股历史DDX数据1()
On Error Resume Next
Columns("A:A").NumberFormatLocal = "@"
[a1:x1] = Split("代码,开盘(元),收盘(元),最高,最低,涨幅,成交量(万元),通吃率,BBD(万元),DDX,DDX3日,DDX5日,DDX10日,DDX60日,DDY,单数比,小单差,小单流入(万元),中单差,中单流入(万元),大单差,大单流入(万元),特大单差,特大单流入(万元)", ",")
Dim temp
With CreateObject("Microsoft.XMLHTTP")
.Open "GET", "http://ddx.gubit.cn/js/astocksuggest.js" & p, True
.Send
Do Until .ReadyState = 4
DoEvents
Loop
temp = Split(.responsetext, "~")
With CreateObject("internetexplorer.application")
.Visible = True
For k = 1 To UBound(temp)
.Navigate "http://ddx.gubit.cn/ddelist.html?code=" & Format(Split(temp(k), "`")(0), "000000") & "&bdate=2012-09-14&edate=2012-09-27"
Do Until .ReadyState = 4
DoEvents
Loop
n = Range("b65536").End(xlUp).Row
Set r = .Document.getElementByid("sjtableright").Rows
For i = 1 To r.Length - 2
For j = 0 To r(i).Cells.Length - 1
Cells(i + n, j + 2) = r(i).Cells(j).innerText
Next j
Next i
m = Range("b65536").End(xlUp).Row
Range(Cells(n + 1, 1), Cells(m, 1)) = Format(Split(temp(k), "`")(0), "000000")
Set r = Nothing
Next k
.Quit
End With
End With
Cells.Font.Size = 9
Cells.Columns.AutoFit
End Sub |