當前位置:首頁 » 編程語言 » 新浪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要下載編譯器嗎 發布:2025-09-20 16:49:27 瀏覽:131
javaprintwriter 發布:2025-09-20 16:48:43 瀏覽:759
代數式編譯 發布:2025-09-20 16:08:38 瀏覽:19
如何配置6摩爾的醋酸 發布:2025-09-20 15:48:48 瀏覽:712
暴風文件夾 發布:2025-09-20 15:39:31 瀏覽:817
文件夾自動生成exe 發布:2025-09-20 15:11:45 瀏覽:876
水密碼去角質啫喱如何使用 發布:2025-09-20 15:10:38 瀏覽:474
貪吃蛇代碼java 發布:2025-09-20 15:04:45 瀏覽:817
kindle壓縮 發布:2025-09-20 15:01:16 瀏覽:764
新浪java 發布:2025-09-20 14:54:46 瀏覽:709