我使用Java jsoup从http://www.aastocks.com/en/ltp/rtquote.aspx?symbol=00055&process=y
获取“最后”价格我的代码:
String price = null;
Document document = Jsoup.connect("http://www.aastocks.com/tc/ltp/rtquote.aspx?symbol=00055").ignoreHttpErrors(true).timeout(5*1000).get(); // s
Elements answerers = document.select(".C.font28.bold ");
price = answerer.text();
}
System.out.println(price);
但它返回:
run:
BUILD SUCCESSFUL (total time: 0 seconds)
请帮忙
答案 0 :(得分:0)
获得例如使用Firefox的CSS Selector:
你会得到这个CSS路径:
html body div #AAMainMaster div.floatL div.frame_w.floatL div div.c_w div.div-container div.RContentBox.floatL form #aspnetForm div.div-container div.floatL div.div-container.bmp-s1 div#rtQuoteRightContent.floatL div.div-container table.tb-s4 tbody tr td.DR.bold
希望这有帮助
问候