A. 股市行情数据导入数据库
你下载excel 再手工转成 SQL类型的数据,只手工进行,或者是做2个程序,一个程序是固定时间段自动下载某个网站的数据excel 表,再作个程序,固定时间段将excel 自动转成SQL,也可以2程序做一起,不过这种方法只能算手工自动话,谈不上动态数据更新(因为数据更新反映时间过长),而且程序制作和运行的工作量巨大.
要想完全的数据动态更新,你必须和对方的数据库有数据连接.基本上要花钱,估计也是你最难办到的,你看那些股票类网站那个不要花钱花去采集数据源?
B. 如何获取股票数据与历史数据以数据库方式存储的
股票历史数据查询有个很不错的网页工具可以推荐,地址是http://tool.cnfunny.cn/#/打开就可以直接使用,还可以大批量下载,方便省事!
C. 如何实时写股票数据进数据库
既然你自己设计了一个数据库,现在是每天收盘后,从同花顺软件里导出EXCEL,再导入数据库,来进行分析。那么你想及时查看开盘数据,那就用同样的技术,从同花顺软件里导出EXCEL,再导入数据库进行分析好了,向你学习!
D. 如何把股票数据导入数据库
先从菜单栏里找到数据导出(保存),导出为EXCEL,然后打开统计软件或数据库,再找到文件(数据)导入,把EXCEL导入。
一般都是这个方法,不同的软件有一定差异。
E. java爬虫实时获取页面数据并存入数据库
response push的html标签你能拿到,就能按规律全部遍历出来,代码网上很多
F. 如何把股票的即时行情的数据添加到数据库里
股票行情是什么格式的数据?
G. 怎么做实时的股票数据库
如果主站提供有相关的接口的话,可以调主站的接口.如果主站不提供相关接口.那就不不断抓取.获取最新的信息了.
H. 如何批量获取股票实时数据,并存储在本地
1. 股票交易数据量实在太大,Excel不能胜任。
2. 股票交易的数据接口似乎也不太好找
I. Java 从网页抽取数据 存入数据库
台风的编号和名称直接在源码中有,但时间和地理位置我只能跟踪到
function totf(tfbh){
location.href( "Typhoon.aspx?id="+tfbh);
}
数据需要从aspx中拿到的,应该是存放到数据库的,页面上是拿不到的
我认为可以通过循环模拟发送请求Typhoon.aspx?id="+XXX,然后通过解析response包的方式可以获得详细的信息
下面一个页面是讲模拟发送请求的
http://tis2005.javaeye.com/blog/195544
希望对你有帮助
我写了一段获得一组数据的代码
//get Typhoon content by param
public static String getTyphoon(String param) {
URL url = null;
try {
url = new URL(param);
} catch (MalformedURLException e) {
e.printStackTrace();
}
HttpURLConnection connection = null;
InputStream is = null;
try {
connection = (HttpURLConnection) url.openConnection();
is = connection.getInputStream();
} catch (IOException e) {
e.printStackTrace();
}
BufferedInputStream bis = new BufferedInputStream(is);
int len = 0;
byte[] buf_all = new byte[0];
try {
while (true) {
byte[] buf1 = new byte[4096];
byte[] buf2 = buf_all;
len = bis.read(buf1);
if(len <= 0){
break;
}
buf_all = new byte[len+buf2.length];
System.array(buf2, 0, buf_all, 0, buf2.length);
System.array(buf1, 0, buf_all, buf2.length, len);
}
} catch (IOException e) {
e.printStackTrace();
}
String content = null;
try {
content = new String(buf_all, "utf-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
int startIndex = content.indexOf("var ary0=")+9;
content = content.substring(startIndex);
int endIndex = content.indexOf("var aryyb0=");
content = content.substring(0, endIndex);
return content;
}
得到的结果是这样的:
[['200906','2009-07-19 20:00:00','23.8','109.6','','15','','','260','','','54440','','莫拉菲','Molave','7'],
['200906','2009-07-19 15:00:00','23.5','111','993','15','25','西北西','260','','','54439','','莫拉菲','Molave','7'],
['200906','2009-07-19 14:00:00','23.3','111.2','','18','','','260','','','54438','','莫拉菲','Molave','8'],
['200906','2009-07-19 13:00:00','23.3','111.5','990','18','25','西北西','260','','','54437','','莫拉菲','Molave','8'],
['200906','2009-07-19 12:00:00','23.2','111.8','990','18','25','西北西','260','','','54436','','莫拉菲','Molave','8'],
['200906','2009-07-19 11:00:00','23.2','112.1','987','18','25','西北西','260','','','54435','','莫拉菲','Molave','8'],
['200906','2009-07-19 10:00:00','23.2','112.4','987','18','25','西北西','260','','','54434','','莫拉菲','Molave','8'],
['200906','2009-07-19 09:00:00','23','112.6','987','20','25','西北西','260','','','54433','','莫拉菲','Molave','8'],
['200906','2009-07-19 08:00:00','22.9','112.9','987','20','','','260','','','54432','','莫拉菲','Molave','8'],
['200906','2009-07-19 07:00:00','22.9','113.2','985','23','25','西北西','260','','','54431','','莫拉菲','Molave','9'],
['200906','2009-07-19 06:00:00','22.8','113.4','982','25','25','西北西','260','','','54430','','莫拉菲','Molave','10'],
['200906','2009-07-19 05:00:00','22.7','113.7','980','28','25','西北西','260','','','54429','','莫拉菲','Molave','10'],
['200906','2009-07-19 04:00:00','22.7','114','975','30','25','西北西','260','','','54428','','莫拉菲','Molave','11'],
['200906','2009-07-19 03:00:00','22.7','114.2','975','33','25','西北偏西','260','80','','54426','','莫拉菲','Molave','12'],
['200906','2009-07-19 02:00:00','22.6','114.5','','35','','','260','80','','54425','','莫拉菲','Molave','12'],
['200906','2009-07-19 01:00:00','22.5','114.5','970','35','28','西北西','260','80','','54424','','莫拉菲','Molave','12'],
['200906','2009-07-19 00:00:00','22.5','114.8','965','38','28','西北西','260','80','','54423','','莫拉菲','Molave','13'],
['200906','2009-07-18 23:00:00','22.4','115.1','','38','','','260','80','','54422','','莫拉菲','Molave','13'],
['200906','2009-07-18 22:00:00','22.3','115.5','965','38','25','西北西','260','80','','54421','','莫拉菲','Molave','13'],
['200906','2009-07-18 21:00:00','22.2','115.7','965','38','25','西北西','260','80','','54420','','莫拉菲','Molave','13'],
['200906','2009-07-18 20:00:00','22.2','116','','35','','','260','80','','54419','','莫拉菲','Molave','12'],
['200906','2009-07-18 19:00:00','22.2','116.2','970','35','25','西北偏西','260','80','','54418','','莫拉菲','Molave','12'],
['200906','2009-07-18 18:00:00','22.1','116.5','970','35','25','西北偏西','260','80','','54417','','莫拉菲','Molave','12'],
['200906','2009-07-18 17:00:00','22','116.7','970','35','25','西北西','260','80','','54416','','莫拉菲','Molave','12'],
['200906','2009-07-18 16:00:00','21.9','116.9','970','35','25','西北偏西','260','80','','54415','','莫拉菲','Molave','12'],
['200906','2009-07-18 15:00:00','21.8','117.1','970','35','25','西北偏西','260','80','','54414','','莫拉菲','Molave','12'],
['200906','2009-07-18 14:00:00','21.7','117.2','970','35','25','西北西','260','80','','54413','','莫拉菲','Molave','12'],
['200906','2009-07-18 13:00:00','21.7','117.4','970','35','25','西北西','260','80','','54412','','莫拉菲','Molave','12'],
['200906','2009-07-18 12:00:00','21.6','117.5','975','33','25','西北西','260','80','','54411','','莫拉菲','Molave','12'],
['200906','2009-07-18 11:00:00','21.6','117.7','975','33','25','西北西','260','80','','54410','','莫拉菲','Molave','12'],
['200906','2009-07-18 10:00:00','21.6','117.9','975','33','25','西北西','260','80','','54409','','莫拉菲','Molave','12'],
['200906','2009-07-18 09:00:00','21.5','118.2','975','33','25','西北西','260','80','','54408','','莫拉菲','Molave','12'],
['200906','2009-07-18 08:00:00','21.4','118.3','975','33','25','西北偏西','260','80','','54407','','莫拉菲','Molave','12'],
['200906','2009-07-18 07:00:00','21.4','118.5','975','33','25','西北西','260','80','','54406','','莫拉菲','Molave','12'],
['200906','2009-07-18 06:00:00','21.3','118.7','975','33','25','西北西','260','80','','54405','','莫拉菲','Molave','12'],
['200906','2009-07-18 05:00:00','21.2','119','975','33','','','260','60','','54404','','莫拉菲','Molave','12'],
['200906','2009-07-18 04:00:00','21.2','119.2','978','30','25','西北西','260','60','','54403','','莫拉菲','Molave','11'],
['200906','2009-07-18 03:00:00','21.1','119.4','978','30','25','西北偏西','260','60','','54402','','莫拉菲','Molave','11'],
['200906','2009-07-18 02:00:00','21','119.6','978','30','','','260','60','','54401','','莫拉菲','Molave','11'],
['200906','2009-07-18 01:00:00','21','120.1','978','30','25','西北偏西','260','60','','54400','','莫拉菲','Molave','11'],
['200906','2009-07-18 00:00:00','20.9','120.3','978','30','25','西北偏西','260','60','','54399','','莫拉菲','Molave','11'],
['200906','2009-07-17 23:00:00','20.8','120.5','978','30','20','西北偏西','260','60','','54398','','莫拉菲','Molave','11'],
['200906','2009-07-17 22:00:00','20.7','121','978','30','20','西北偏西','260','60','','54397','','莫拉菲','Molave','11'],
['200906','2009-07-17 21:00:00','20.7','121.2','978','30','20','西北偏西','260','60','','54396','','莫拉菲','Molave','11'],
['200906','2009-07-17 20:00:00','20.6','121.5','978','30','20','西北偏西','260','60','','54395','','莫拉菲','Molave','11'],
['200906','2009-07-17 19:00:00','20.4','121.8','980','28','20','西北西','260','60','','54394','','莫拉菲','Molave','10'],
['200906','2009-07-17 18:00:00','20.3','121.9','980','28','20','西北偏西','260','60','','54393','','莫拉菲','Molave','10'],
['200906','2009-07-17 17:00:00','20.2','122.1','980','28','20','西北偏西','200','50','','54392','','莫拉菲','Molave','10'],
['200906','2009-07-17 14:00:00','19.5','122.7','','25','','','200','50','','54391','','莫拉菲','Molave','10'],
['200906','2009-07-17 11:00:00','18.9','123.3','985','25','15','西北','200','50','','54390','','莫拉菲','Molave','10'],
['200906','2009-07-17 08:00:00','18.6','123.6','994','20','','','100','','','54389','','莫拉菲','Molave','8'],
['200906','2009-07-17 05:00:00','18.4','123.9','996','18','15','西北','100','','','54388','','莫拉菲','Molave','8'],
['200906','2009-07-17 02:00:00','17.9','124.1','996','18','15','西北','50','','','54387','','莫拉菲','Molave','8'],
['200906','2009-07-16 23:00:00','17.6','124.6','996','18','15','西北','','','','54386','','莫拉菲','Molave','8'],
['200906','2009-07-16 20:00:00','17.4','124.7','996','18','','','','','','54385','','莫拉菲','Molave','8']];
再下去字符串的拆分实在是太复杂了,不想写了
使用时只要参数为http://www.wztf121.com/Typhoon.aspx?id=
id后是台风的代码号,写一个循环就可以了