導航:首頁 > 科創數據 > 獲取股票數據並存入資料庫

獲取股票數據並存入資料庫

發布時間:2021-08-08 18:01:36

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後是台風的代碼號,寫一個循環就可以了

閱讀全文

與獲取股票數據並存入資料庫相關的資料

熱點內容
姜慧恩演的片 瀏覽:924
最新帶撓腳心的電影 瀏覽:117
劉智苑健身是什麼電影 瀏覽:294
韓國恐怖電影失蹤免費觀看 瀏覽:899
韓劇電影免費看倫理 瀏覽:373
韓國最好看的三極推薦 瀏覽:503
兩個男人一起做鴨子的電影 瀏覽:745
國產恐怖片反派帶著面具拿著菜刀 瀏覽:522
可可托海 電影 瀏覽:472
池恩瑞的作品 瀏覽:18
巨貓電影 瀏覽:178
吃人奶 片段 瀏覽:168
啄木鳥電影都有哪些 瀏覽:298
江湖左手誰演的 瀏覽:670
部隊題材電影軍人可以去影院免費看嗎 瀏覽:564
章子怡 床戲 瀏覽:718
結婚過的男女電影 瀏覽:163
床戲影視 瀏覽:182
想看片卻找不到網站 瀏覽:724
國語電影免費在線 瀏覽:808