以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  关于网页数据收集  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=64394)

--  作者:well_nick
--  发布时间:2015/2/12 17:03:00
--  关于网页数据收集
需求:收集不同股票的网页股票数据
股票 000338 :http://www.dingniu888.com/ddx/912/ddelist.php?code=000338&t=0.5196082259464032&vdate=30&page=1
访问网页直接返回文本数据:
{"total":"23","updatetime":"2015-02-12 15:00:00","data":[{"dtime":"2015-02-12 15:00:00","spj":"25.9","zf":"0.27","cjl":"23583.01","ddx":"-0.029","bbd":"-778.24","ddx3":"-0.109","ddx5":"-0.306","ddx10":"-0.562","ddx60":"-3.714","ddy":"-0.06","dsb":"0.86","xdc":"2.8","zdc":"0.5","ddc":"-2.3","tdc":"-1","kaipan":"25.95","zuigao":"26.04","zuidi":"25.61","tcl":"-3.3"},{"dtime":"2015-02-11 15:00:00","spj":"25.83","zf":"1.02","cjl":"26735.89","ddx":"-0.011","bbd":"-294.09","ddx3":"-0.191","ddx5":"-0.305","ddx10":"-0.638","ddx60":"-3.782","ddy":"-0.057","dsb":"0.889","xdc":"0","zdc":"1.1","ddc":"-0.3","tdc":"-0.8","kaipan":"25.58","zuigao":"26.1","zuidi":"25.58","tcl":"-1.1"},{"dtime":"2015-02-10 15:00:00","spj":"25.57","zf":"1.83","cjl":"30104.67","ddx":"-0.069","bbd":"-1836.39","ddx3":"-0.267","ddx5":"-0.269","ddx10":"-0.799","ddx60":"-3.888","ddy":"-0.069","dsb":"0.868","xdc":"4.3","zdc":"1.8","ddc":"-5","tdc":"-1.1","kaipan":"25.11","zuigao":"25.64","zuidi":"25","tcl":"-6.1"},{"dtime":"2015-02-09 15:00:00","spj":"25.11","zf":"-1.41","cjl":"39085.36","ddx":"-0.111","bbd":"-2931.4","ddx3":"-0.225","ddx5":"-0.317","ddx10":"-0.865","ddx60":"-3.879","ddy":"-0.145","dsb":"0.813","xdc":"6.2","zdc":"1.3","ddc":"-6.2","tdc":"-1.3","kaipan":"25.45","zuigao":"25.46","zuidi":"24.86","tcl":"-7.5"},{"dtime":"2015-02-06 15:00:00","spj":"25.47","zf":"-2","cjl":"39398.27","ddx":"-0.086","bbd":"-2324.5","ddx3":"-0.089","ddx5":"-0.297","ddx10":"-0.743","ddx60":"-3.784","ddy":"-0.126","dsb":"0.835","xdc":"5.8","zdc":"0.1","ddc":"-4.3","tdc":"-1.6","kaipan":"25.96","zuigao":"26.17","zuidi":"25.36","tcl":"-5.9"},
{"zf":-7.4355721393035,"bbd":"-44365.78","tcl":"-3.34037827170964","ddx":"-1.59200002299622","ddy":"-2.17599999252707","xdc":"64.4999993890524","xdcje":"36616.9144564336","zdc":"14.2000001519918","zdcje":"7748.86015072591","ddc":"-54.9999990686774","ddcje":"-29063.4309299843","tdc":"-23.7000004425645","tdcje":"-15302.3436147669"},"page":1,"startdate":"2015-01-13","enddate":"2015-02-12"}
数据列表图片为:

图片点击可在新窗口打开查看此主题相关图片如下:列表.gif
图片点击可在新窗口打开查看

我想把 上面的多个单条记录 "data":[{"dtime":"2015-02-12 15:00:00","spj":"25.9","zf":"0.27","cjl":"23583.01","ddx":"-0.029","bbd":"-778.24","ddx3":"-0.109","ddx5":"-0.306","ddx10":"-0.562","ddx60":"-3.714","ddy":"-0.06","dsb":"0.86","xdc":"2.8","zdc":"0.5","ddc":"-2.3","tdc":"-1","kaipan":"25.95","zuigao":"26.04","zuidi":"25.61","tcl":"-3.3"},
转换成 单条记录:开盘(元)收盘(元)最高最低涨幅成交量(万元)通吃率BBD(万元)DDXDDX3日DDX5日DDX10日DDX60日DDY单数比小单差小单流入(万元)中单差中单流入(万元)大单差大单流入(万元)特大单差特大单流入(万元)
并且插入数据库中。
问题:
1.网页数据收集 是不是需要WebBrowser控件来做,有没有类似例子。
2.转换文本便于插入数据库,能不能把下面的数据转换成 insert into table1 (股票,开盘价、涨幅、交易量。。。)  values(‘000338’,‘26.6’,\'0.6\',\'22332\').
{"dtime":"2015-02-12 15:00:00","spj":"25.9","zf":"0.27","cjl":"23583.01","ddx":"-0.029","bbd":"-778.24","ddx3":"-0.109","ddx5":"-0.306","ddx10":"-0.562","ddx60":"-3.714","ddy":"-0.06","dsb":"0.86","xdc":"2.8","zdc":"0.5","ddc":"-2.3","tdc":"-1","kaipan":"25.95","zuigao":"26.04","zuidi":"25.61","tcl":"-3.3"},
 

--  作者:有点甜
--  发布时间:2015/2/12 17:05:00
--  

 参考

 

http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=63745&skin=0

 


--  作者:有点甜
--  发布时间:2015/2/12 17:08:00
--  

 获取网上数据,参考

 

http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=25031&replyID=155703&skin=1