當前位置:首頁 » 編程語言 » 新浪java

新浪java

發布時間: 2025-09-20 14:54:46

⑴ 請問怎樣用java獲取股票行情歷史數據新浪、搜狐、百度財經都可以......

publicclassStockConnection{
publicstaticvoidmain(String[]args){
URLur=null;
try{
//搜狐股票行情歷史介面
// ur=newURL("http://q.stock.sohu.com/hisHq?code=cn_300228&start=20130930&end=20131231&stat=1&order=D&period=d&callback=historySearchHandler&rt=jsonp");
//新浪股票行情歷史介面
ur=newURL("http://biz.finance.sina.com.cn/stock/flash_hq/kline_data.php?&rand=random(10000)&symbol=sh600000&end_date=20150809&begin_date=20000101&type=plain");
HttpURLConnectionuc=(HttpURLConnection)ur.openConnection();
BufferedReaderreader=newBufferedReader(newInputStreamReader(ur.openStream(),"GBK"));
Stringline;
while((line=reader.readLine())!=null){
System.out.println(line);
}
}catch(Exceptione){
//TODOAuto-generatedcatchblock
e.printStackTrace();
}
}
}

熱點內容
java返回this 發布:2025-10-20 08:28:16 瀏覽:581
製作腳本網站 發布:2025-10-20 08:17:34 瀏覽:875
python中的init方法 發布:2025-10-20 08:17:33 瀏覽:570
圖案密碼什麼意思 發布:2025-10-20 08:16:56 瀏覽:756
怎麼清理微信視頻緩存 發布:2025-10-20 08:12:37 瀏覽:672
c語言編譯器怎麼看執行過程 發布:2025-10-20 08:00:32 瀏覽:999
郵箱如何填寫發信伺服器 發布:2025-10-20 07:45:27 瀏覽:242
shell腳本入門案例 發布:2025-10-20 07:44:45 瀏覽:102
怎麼上傳照片瀏覽上傳 發布:2025-10-20 07:44:03 瀏覽:794
python股票數據獲取 發布:2025-10-20 07:39:44 瀏覽:700